File Uploader Regex for valid files extensions does not appear to be working

0
0

I am using the following Regex:

([^\s]+(\.(?i)(pdf|ds2))$)

I only want to allow any file with the .PDF or .DS2 extensons – but the file uploader is letting any file extension through to be uploaded.

Which works in online regex tester: https://regex101.com/

 

Any Ideas ?

  • You must to post comments
0
0

The AllowedFileTypes property is not a regex, it’s a weird IANA Media Types specifications and not all browsers use it correctly.

It’s not a Wisej thing. Uploading of files is entirely in the hands of the browser.

See also:

https://docs.wisej.com/api/wisej.web/content/upload#allowedfiletypes

https://www.w3schools.com/tags/att_input_accept.asp

 

  • edmond girardi
    Ahh i See – in Visual Studio – the property help says its a regular expression
  • Luca (ITG)
    Just saw it. Thanks, will fix.
  • edmond girardi
    Well, that does not help I guess. I only want them to upload specific file extensions. I guess I’m going to have to filter it behind the scenes via code.
  • Luca (ITG)
    You can, use “.xls,.doc”. See the examples in https://www.w3schools.com/tags/att_input_accept.asp
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.