problem with the "fileUpload" component in safari with accents

UI Components for JSF
Post Reply
cristina.sandoval
Posts: 9
Joined: 27 Oct 2016, 19:02

16 May 2018, 17:26

I did the test in the page of primefaces with the last template I get the error, I'm trying with version 11.3 of safari.

Image

Image

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

17 May 2018, 13:42

It looks like the allowTypes="" property is being used and the error is "Invalid File Type" like your extension doesn't match the allowTypes==" property?
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

cristina.sandoval
Posts: 9
Joined: 27 Oct 2016, 19:02

18 May 2018, 02:53

but if I upload the same file where the address does not contain an accent, it does not send me the error.

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

18 May 2018, 13:32

Interesting. This snippet of Javascript appears to be the problem in 2-fileupload.js.

Code: Select all

if (this.cfg.allowTypes && !(this.cfg.allowTypes.test(file.type) || this.cfg.allowTypes.test(file.name))) {
            return this.cfg.invalidFileMessage;
}
It is using Regular Expression javascript to test the filename and its returning false.

https://www.w3schools.com/jsref/jsref_regexp_test.asp
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests