-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Folder identifiers sometimes have / at the end, sometimes not #146
Labels
Comments
|
cweiske
added a commit
to mogic-le/aus_driver_amazon_s3
that referenced
this issue
Jan 23, 2024
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: andersundsehr#146
cweiske
added a commit
to mogic-le/aus_driver_amazon_s3
that referenced
this issue
Jan 23, 2024
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: andersundsehr#146
cweiske
added a commit
to mogic-le/aus_driver_amazon_s3
that referenced
this issue
Jun 17, 2024
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: andersundsehr#146
cweiske
added a commit
to mogic-le/aus_driver_amazon_s3
that referenced
this issue
Sep 6, 2024
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: andersundsehr#146
cweiske
added a commit
to mogic-le/aus_driver_amazon_s3
that referenced
this issue
Sep 6, 2024
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: andersundsehr#146
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Different methods in
AmazonS3Driver
return folder identifiers differently:AmazonS3Driver::createFolder
returns identifiers with a slash at the end:folder/
AmazonS3Driver::getFolder
returns identifiers without a slash:foldername
.AmazonS3Driver::getFolderInfoByIdentifier
returns identifiers without a slash:foldername
.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 offolder/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.
The text was updated successfully, but these errors were encountered: