Back

[SOLVED] Bucket does not allow extension that is of uppercase letter

  • 0
  • Storage
Said H
5 Jun, 2023, 08:49

Hello, I have a bucket that accepts *.jpg. It can accept any jpg file successfully. However, when I upload image with *.JPG, it fails with error: Warning: An unhandled error was caught from submitForm() Error: File extension not allowed

Is there a way to make the whitelisted extensions case-insensitive? Thanks.

TL;DR
The user had an issue with a bucket not allowing uppercase file extensions. They initially added all the uppercase versions of the extensions, but then realized that the bucket actually allows free entries. Another user mentioned that the checking process for file extensions is arbitrary and provided a link to the code for reference. The suggested solution for now is to add all the uppercase versions of the extensions. It is also suggested to consider this as a potential issue or feature request.
Binyamin
5 Jun, 2023, 12:47

As of now there going to different between lower & upper case. You can see here https://github.com/utopia-php/storage/blob/main/src/Storage/Validator/FileExt.php#L50 the checking process is pretty arbitrary.

For now, you can the best option would be to ass all the uppercase version for your extensions, From what I can tell it sounds like good issue / feature request.

Said H
5 Jun, 2023, 12:57

hey Binyamin, i just realized that it allows free entries. My apologies. i thought i was only allowed to select the options indicated in the fields only

Said H
5 Jun, 2023, 12:57

i have proceeded to add all the uppercase version of the extensions

Said H
5 Jun, 2023, 12:57

thanks so much for this

Said H
5 Jun, 2023, 12:57

[SOLVED] Bucket does not allow extension that is of uppercase letter

Binyamin
5 Jun, 2023, 12:58

👍

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more