Making FileUploader accept only .jpg or .JPG formats (Solved)

Hello! My requirement is to restrict FileUploader from accepting any other file format other than .jpg or .JPG (in both lower and uppercase). My approach for it in the below screengrab doesn’t seem to be working! With this condition its only accepting the first format which is .JPG and ignoring .jpg. Can someone please guide me or suggest a better approach to this? Thx

Why do you need this? If you tell us your need, maybe we can help figuring something out

You may find this conversation and @fayewatson’s suggestion linked in that post helpful. Restrict file types

Hello ! Im trying a building a app where users can uploaded pictures (only .jpg) but there are cases where the extension can also be in uppercase ‘.JPG’ and Im trying to handle both cases.

I did look up the post on ‘Restrict file types’ and it doesn’t fully address my issue of allowing two different file extensions (.JPG & .jpg). Can I please get some help?

Try this:

1 Like

Your response in just 3min worked like a charm!! Thank you so much ‘mebeingken’… really appreciate it!

This topic was automatically closed after 70 days. New replies are no longer allowed.