Bug #64330
closeddumpFileContents does not work as intended when compression is enabled
0%
Description
I'm not really sure if this is a bug or a feature.
When you enable compression for the backend (e.g. [BE][compressionLevel] = 9), then dumpFileContents in TYPO3\CMS\Core\Resource\ResourceStorage does dump the given filecontent gzip compressed. Actually I would have supposed, that dumpFileContents always should just dump the content of the file and don't care about compression.
The following code can be used in an action of a backend module to test the problem.
$storage = $this->resourceFactory->getDefaultStorage(); $file = $storage->getFile('test.jpg'); $storage->dumpFileContents($file, TRUE, 'test-filename.jpg');
The file "test-filename.jpg" gets dumped and is not readable, as it it compressed.
When showing fileinfo for the file, it shows
file test-filename.jpg test-filename.jpg: gzip compressed data, from Unix, max compression
I could not reproduce this in frontend when setting [FE][compressionLevel] = 9, as the file in FE is not dumped at all (only a 0 bytes file is saved). Using [FE][compressionLevel] = 0 dumps the file correctly.