Can I restrict user to not use comma and special characters in the uploaded filename ?

  • Career_at_BOR
    Asked on April 5, 2016 at 2:09 PM

    I have a Jotform which lets users to attach files. I want to restrict users to not use special characters like commas, asterik, brackets in the name of the files they attach. For example, a user should not be able to attach a file with name MY_OWN,FILE.pdf or MY_OWN*FILE.pdf

    How can I restrict form users to only use standard alpha numeric characters ? They can obviously use underscore or hypen but using commas, asteriks or brackets really looks bad.

     

    Is their a way ?

     

    Thanks for helping

  • David JotForm Support
    Replied on April 5, 2016 at 2:52 PM

    Most of those characters should not be allowed in file names to begin with:

    Can I restrict user to not use comma and special characters in the uploaded filename ? Image 1 Screenshot 20

    For the most part, those characters would break the functionality of the file in many circumstances. 

  • Career_at_BOR
    Replied on April 5, 2016 at 2:56 PM

    well David,

    I am not a Windows user but on Linux Ubuntu, you can name files containing these characters. So it is possible my friend. And I have received people making submissions on my Jotform with all the funny characters. So it is happening in the real world and is making me go nuts. A solution is desperately required.

  • David JotForm Support
    Replied on April 5, 2016 at 3:12 PM

    My apologies, I was testing with an image file, not a PDF.  Unfortunately, we only have validation in place to check for valid file types and naming conventions.  Since many characters are indeed acceptable when labeling PDF's those that are acceptable will pass our validation. 

  • beril JotForm UI Developer
    Replied on April 6, 2016 at 4:13 AM

    I am sorry to say that it is not possible with Jotform. However, to prevent that issue, you can add a hover text to that file as you see below.

    Can I restrict user to not use comma and special characters in the uploaded filename ? Image 1 Screenshot 20

    If you have any question or issues, please do not hesitate contacting us. We will be glad to assist you.