MaxServ / t3ext-fal_s3

S3 driver for FAL
GNU General Public License v2.0
13 stars 10 forks source link

Using special characters in file- or directory names sometimes lead to an error #56

Closed djcprinse closed 1 year ago

djcprinse commented 4 years ago

Currently there is no error handling for file and directory names containing characters other than alphanumeric or some specials characters. As Amazon explains in their documentation, which can be found at https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#object-keys, only some special characters can be used safely.

As you read the documentation, only the following non-alphanumeric characters can be used safely without escaping ! - _ . * ' ( ). Other special characters might need special handling or are recommended to avoid.

It can be solved by overriding the sanitizeFileName function, just like it has been done at the LocalDriver: https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php#L318. The Amazon S3 specific rules should be implemented to make it work correctly.