In PHP there is a method called "readfile" which allows to directly output a file to output stream. This allows to output files larger than the available amount of memory because the whole file doesn't have to get read into memory.
Such a method is missing for FAL. There should be some method "outputContent" which reads in file data in chunks and outputs them using "echo".
Or propose another solution for sending large files to the browser.
[TASK] Add possibility to dump file to browser
The FileAbstractionLayer currently only provides the possibility to
retrieve the contents of a file as a string. If you want to output
a file this would lead to a massive memory overhead for large files
when building some kind of download/jumpurl/access-restricted download
This change adds a method "dumpFileContents" to the ResourceStorage
allowing to directly output the contents of the file including setting
In addition it introduces a new method (same name) in the DriverInterface
and implements it in the LocalDriver.
Reviewed-by: Frans Saris
Reviewed-by: Philipp Gampe
Reviewed-by: Ingo Schmitt
Reviewed-by: Sebastian Fischer
Tested-by: Sebastian Fischer
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack
[BUGFIX] FAL: Followup to New dump file to browser
Cache control headers need to be sent for IE8 and
HTTPS combination. See #16491 for more details.
#2 Updated by Bernhard Kraft over 6 years ago
If the URI is not public readable I am stuck to stream handlers. It would be nice to have an abstract way of doing this instead of having to implement for every possible storage driver.
Note that I set this as "should have" and "feature". So ... no hassle.