70820[FEATURE] Allow to download files from file list directly
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Benjamin Franzke +1
- Oli Bartsch +1
-
Verified V +2 Done
- Benni Mack +2
- Benjamin Franzke +1
- Oli Bartsch +1
- core-ci +1 CI
Issues 1
Files 16
- Build/Sources/Sass/nprogress/_nprogress.scss+1 −0
- Build/Sources/TypeScript/filelist/Resources/Public/TypeScript/ContextMenuActions.ts+37 −0
- Build/Sources/TypeScript/filelist/Resources/Public/TypeScript/FileList.ts3+85 −0
- typo3/sysext/backend/Resources/Public/Css/backend.css+1 −1
- typo3/sysext/core/Documentation/Changelog/master/Feature-90548-DownloadMultipleFilesAndFoldersInFilelist.rstnew+35 −0
- typo3/sysext/core/Resources/Private/Language/locallang_core.xlf+9 −0
- typo3/sysext/filelist/Classes/ContextMenu/ItemProviders/FileProvider.php+34 −1
- typo3/sysext/filelist/Classes/Controller/FileDownloadController.php9new+132 −0
- typo3/sysext/filelist/Classes/Controller/FileListController.php+7 −1
- typo3/sysext/filelist/Classes/FileList.php7+13 −0
- typo3/sysext/filelist/Configuration/Backend/Routes.php+6 −0
- typo3/sysext/filelist/Configuration/Services.yaml+3 −0
- typo3/sysext/filelist/Resources/Private/Language/locallang.xlf+3 −0
- typo3/sysext/filelist/Resources/Private/Templates/File/List.html+7 −0
- typo3/sysext/filelist/Resources/Public/JavaScript/ContextMenuActions.js+1 −1
- typo3/sysext/filelist/Resources/Public/JavaScript/FileList.js+1 −1
Review log 3753
Show 1828 earlier messages
-
Benni Mack uploaded patch set 1 08/30/21, 09:28
-
Benjamin Franzke commented on patch set 1 08/30/21, 09:33
-
Benjamin Franzke commented on patch set 1 08/30/21, 09:36
FileDownloadController.php:69ReplyWell, no, bad idea, as we'd want the tmpfile to be deleted at some point… :\ -
Benni Mack commented on patch set 1 08/30/21, 09:37
FileDownloadController.php:69ReplyDidn't get it working with \ZipArchive and a stream in another way :( -
core-ci voted on patch set 1 V -1 08/30/21, 09:43 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15847
-
Benni Mack uploaded patch set 2 08/30/21, 15:45
-
core-ci voted on patch set 2 V -1 08/30/21, 16:03 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15880
-
Benni Mack uploaded patch set 3 08/30/21, 16:21
-
core-ci voted on patch set 3 V -1 08/30/21, 16:34 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15883
-
Benni Mack uploaded patch set 4 08/30/21, 16:53
-
core-ci voted on patch set 4 V -1 08/30/21, 17:09 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15885
-
Benni Mack uploaded patch set 5 08/30/21, 17:44
-
core-ci voted on patch set 5 V -1 08/30/21, 18:03 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15888
-
Benni Mack uploaded patch set 6 08/30/21, 18:04
-
core-ci voted on patch set 6 V +1 08/30/21, 18:18 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15890
-
Oli Bartsch uploaded patch set 7 08/30/21, 23:40
-
core-ci voted on patch set 7 V +1 08/30/21, 23:55 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15899
-
Benjamin Franzke commented on patch set 7 08/31/21, 04:26
FileDownloadController.php:65We should delete the tmpfile after creating the response. -
Oli Bartsch uploaded patch set 8 08/31/21, 10:23
-
Oli Bartsch commented on patch set 8 V +1 CR +1 08/31/21, 10:39
FileDownloadController.php:65ReplyDone -
core-ci voted on patch set 8 V -1 08/31/21, 10:41 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15920
-
core-ci voted on patch set 8 V +1 08/31/21, 11:00 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15920
-
Benjamin Franzke commented on patch set 8 CR -1 08/31/21, 11:59
Well, actually a zip file is also generated if only one file is selected, right? Would that be much effort to avoid zip file generation in that case as well?FileList.ts:225fileName might be null. (e.g. in case an error occured, then the header Content-Disposition might not be available) Example for an error (if the filesize is larger than server memory limit): <br /> <b>Fatal error</b>: Allowed memory size of 134217728 bytes exhausted (tried to allocate 209757528 bytes) in <b>[…]/typo3/sysext/filelist/Classes/Controller/FileDownloadController.php</b> on line <b>81</b><br />FileList.ts:228Hm.. So I guess this is taken from https://stackoverflow.com/a/9834261/4223467 The curlpit is: Even if we generate a 200MB zip, this will now be stored in memory. Not nice, but I didn't experience problems on my fast pc right now, don't know though how PCs with limited memory will like this…FileDownloadController.php:48We need to check whether items is empty. Will then result into a PHP WARNING if empty: PHP Warning: file_get_contents(/tmp/php4y3k0m): failed to open stream: No such file or directory in […]/typo3/sysext/filelist/Classes/Controller/FileDownloadController.php line 81 -
Oli Bartsch uploaded patch set 9 08/31/21, 14:58
-
Oli Bartsch commented on patch set 9 08/31/21, 15:03
Reply
This is only the case if the "multi record selection action" is used. For this case it's IMO fine since this action should be used for multiple files/folders. Single download can be achieved via the actions in context menu / secondary menu. It's furthermore not that easy to achieve since there is only one array "filesAndFolders" to keep the correct order. We sure could check after preparing this array if its length is one, but we then still don't know if it's a file or a folder, since only the identifier is stored as value.FileList.ts:225ReplyDoneFileDownloadController.php:48ReplyDone -
core-ci voted on patch set 9 V +1 08/31/21, 15:28 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15949
-
Oli Bartsch voted on patch set 9 V +1 CR +1 08/31/21, 15:29
-
Benjamin Franzke uploaded patch set 10 09/01/21, 06:36
-
Benjamin Franzke commented on patch set 10 09/01/21, 06:38
Reply
AckFileList.php:1003Would be nice if the download-cell-actions would be handled by javascript as well: a) …to show nprogress b) to check for possible errors in order to present a Notification (instead of currently an error in the iframe) …but that not strictly required and not wrong right now, therefore I consider that optional. -
core-ci voted on patch set 10 V +1 09/01/21, 06:51 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15981
-
Oli Bartsch voted on patch set 10 V +1 CR +1 09/01/21, 07:13
-
Benjamin Franzke commented on patch set 10 CR -1 09/01/21, 07:14
temporary CR-1 as Helmut would like to take a quick look.FileList.php:1003@Helmut: Fine with this? -
Helmut Hummel commented on patch set 10 CR -1 09/01/21, 07:24
FileList.php:1003ReplyNooe. Please remove the call to PathUtility here. It is not required any more since FAL Urls are now always absolute -
Benni Mack commented on patch set 10 CR -1 09/01/21, 08:05
on it -
Benni Mack uploaded patch set 11 09/01/21, 08:15
-
Benni Mack uploaded patch set 12 09/01/21, 08:24
-
Benni Mack commented on patch set 12 09/01/21, 08:24
ready to review -
Benni Mack uploaded patch set 13 09/01/21, 08:26
-
core-ci voted on patch set 11 V +1 09/01/21, 08:32 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15985
-
Benjamin Franzke commented on patch set 13 V -1 09/01/21, 08:35
Sorry, one thin left: It fails to download empty folders: PHP Warning: file_get_contents(/tmp/phpcz7zQT): failed to open stream: No such file or directory in /home/ben/src/TYPO3.CMS/typo3/sysext/filelist/Classes/Controller/FileDownloadController.php line 88 -
Benni Mack uploaded patch set 14 09/01/21, 08:40
-
core-ci voted on patch set 12 V +1 09/01/21, 08:43 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15987
-
core-ci voted on patch set 14 V -1 09/01/21, 08:43 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15989
-
core-ci voted on patch set 13 V -1 09/01/21, 08:47 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15988
-
Benjamin Franzke commented on patch set 13 09/01/21, 08:48
Reply
See https://www.php.net/manual/en/ziparchive.close.php#78667 > Don't forget to check the zip isn't empty, folks - otherwise the zip won't be created at all, and the server will issue no warning! So we probably need to count the files that have been added. Or – even better, also add empty directories via ZipArchive::addEmptyDir – but that'd require quite a rewrite of the recursive-file-iterator.FileList.php:996jsonEncodeForHtmlAttribute doesn't work here. causes: "1:/introduction/" to be outputted as: "1:\/introduction\/" then the download of course files. So we should use htmlspecialchars here. -
Benjamin Franzke uploaded patch set 15 09/01/21, 08:56
-
Benjamin Franzke commented on patch set 15 09/01/21, 08:56
FileDownloadController.php:75^^ $zipFileName has not be created at this point, so need to unlink – otherwise it'll fail with PHP Warning: unlink(/tmp/phpI9vGDe): No such file or directory in /home/ben/src/TYPO3.CMS/typo3/sysext/filelist/Classes/Controller/FileDownloadController.php line 75FileList.php:996ReplyDone -
Benjamin Franzke commented on patch set 15 09/01/21, 08:57
FileDownloadController.php:75ReplyDone -
Benjamin Franzke commented on patch set 15 09/01/21, 08:57
FileList.php:1003ReplyDoneFileList.php:1003ReplyDone -
core-ci voted on patch set 15 V +1 09/01/21, 09:14 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15992
-
Oli Bartsch voted on patch set 15 V +1 CR +1 09/01/21, 09:25
-
Benni Mack commented on patch set 15 V +2 CR +2 09/01/21, 09:29
Thanks for making sure this feature is OK -
Benni Mack merged patch set 16 09/01/21, 09:29
FileDownloadController.php:69