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

Folder identifiers sometimes have / at the end, sometimes not #146

Open cweiske opened 10 months ago

cweiske commented 10 months ago

Different methods in AmazonS3Driver return folder identifiers differently:

This leads to the problem that creating a new file via addFile($localFilePath, $targetFolderIdentifier, $newFileName) will not put the file within the folder, but in the parent folder:

addFile('/tmp/foo', 'folder', 'filename.txt') creates /folderfilename.txt instead of folder/filename.txt.

Some methods already handle folder identifiers without slash and with slashes:

Other methods do not add slashes:

The question is now if folder identifiers should always have a slash at the end or not. The decision to that question determines what needs to be done to solve the bugs.

cweiske commented 10 months ago

AbstractHierarchicalFilesystemDriver::canonicalizeAndCheckFolderIdentifier appends a slash when missing, so I guess that folders should always have a slash at the end.