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

User avatar
Melloware
Posts: 757
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 Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 6.2.10 / PF Extensions 6.2.9

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.

User avatar
Melloware
Posts: 757
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 Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 6.2.10 / PF Extensions 6.2.9

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests