Services Plugins FAQs

AWS File Uploader - upload to S3

Please suggest,
How can I replace special characters from file name ?? I have regex to replace but I want a event which allow me to change and send new file name to S3.

Regards,
Poonam.

Hello, @poonam
Thanks for reaching out.

Unfortunately, but the symbols like space, - _ . ! ~ * ’ ( ) cannot be recognized and encoded by the AWS platform.
In order to prevent the download from being canceled, all invalid characters are replaced by “%”.
The plugin returns you not the name of the file from the bucket, but the original name of the file.
Please check this documentation in case of necessity: encodeURIComponent() - JavaScript | MDN

In case if you are willing to rename the files in the S3 bucket after the files will be uploaded, it is possible only manually.

In case I can help you with any additional information - please let me know.
Best regards,

Thank you for the prompt reply.

Agree with you on this.
But I want to replace all special character from file name before I send object to S3
A question arise here, Can we replace special character in “File upload GUI” element it self ??

Thank you.

Hello, @poonam
Thanks for your suggestion.

Please allow me to mention that replacing the spaces and special characters is possible only with your manual impact.
The plugin doesn’t replace them automatically.
The plugin returns you not the name of the file from the bucket, but the original name of the file.
Please check this documentation in case of necessity: encodeURIComponent() - JavaScript | MDN

The simplest way to avoid issues with file uploading is to follow the list with the wrong characters and just to delete them from the title.
So, you upload a file to the bucket and in your S3 can see the name of the file, which were uploaded. But the plugin returns you not the name of the file from the bucket, but the original name of the file.

In case I can help you with any additional information - please let me know.
Best regards,

Thank you.
This seems like a possible solutions.
But can you please guide me how to male the list with the wrong characters
and where to write this so that "Fileuploader GUI " element can work on it.
I really want to delete them from the file name, so that S3 do not need to process encodeURICompenent() stuff. and return me the simple “uuid_filename.***”

Thanks
P.

Hello, @poonam

I’m sorry that my answer was not complete for you. Please allow me to describe one more time this flow.
When you are uploading the file with a special character in the title, the plugin automatically encodes these symbols and replaces them with a “%”.
It is impossible to disable this behavior of the plugin.

In the provided link (encodeURIComponent() - JavaScript | MDN) you can find just a description of the function.

In case you don’t want to upload files with special characters, just rename the file by yourself.
This is the only possibility.

But please note once again, you upload a file to the bucket and in your S3 can see the name of the file, which were uploaded. But the plugin returns you not the name of the file from the bucket, but the original name of the file.

In case I can help you with any additional information - please let me know.
Best regards,

I have a similar issue.
I have files that I would like to upload, and their names contain underscores. The uploader removes them, and then adds in an underscore between the uuid and my filtered filename. Is there any way to stop this behavior? Underscores must be allowed by AWS, as the fileuploader is adding them in new places.

Hello, @nedmohr
Thanks for reaching out.

Please note that the current plugin version removes all special symbols since they could not be detected by the AWS platform: encodeURIComponent() - JavaScript | MDN

However, as you already mentioned, the underscores are added by the platform after uploading as a separator between information.

Unfortunately, there is no possibility to avoid encoding the file in the AWS S3 bucket.

Sorry for the inconvenience.
Best regards,