andersundsehr / aus_driver_amazon_s3

Provides a TYPO3 FAL driver for the Amazon Web Service S3
GNU Lesser General Public License v3.0
21 stars 40 forks source link

[BUGFIX] Append slash to folder identifiers #147

Open cweiske opened 10 months ago

cweiske commented 10 months ago

This patch fixes the problem that fetching a folder via API and using that to upload a file put the file into the wrong folder:

$folder = $storage->getFolder('myfolder');
$storage->addFile('/tmp/file.txt', $folder, 'file.txt');
//created "/myfolderfile.txt" instead of "/myfolder/file.txt"

TYPO3's own AbstractHierarchicalFilesystemDriver::canonicalizeAndCheckFolderIdentifier appends slashes, and our createFolder() already returned identifiers with slashes at the end.

Resolves: https://github.com/andersundsehr/aus_driver_amazon_s3/issues/146