New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
angular-file-upload-shim does not work correctly on Chrome - Failed to execute 'setRequestHeader' on 'XMLHttpRequest' #579
Comments
Can you post your code here or create a jsfiddle from the sample jsfiddle on readme file. |
+1 |
You guys need to create a jsfiddle or a running code to show the error. As long as the demo page is working you probably have an error in your setup of the library or conflicting libraries. |
Thanks for the update. I fixed the problem by rearrange the javascript files. |
This does not work for me when I use it with pace.js. XMLHttpRequest gets replaced by pace, so the setRequestHeaders gets back to its native implementation... |
You can probably fix it by rearranging the scripts. Make the pace load first and then angular and then angular-file-upload. or play with the order. |
I had the same issue start occurring randomly & it turned out to be due to moving pace.js to load before this lib. I fixed it by removing pace.js |
Got same issue. Removing pace.js seems to fix it, however would be nice to support it |
+1 for same issue and removing pace (not changing it's position in the load) fixed the issue. |
If you guys want this to be fixed faster please create a jsfiddle showing the error: steps to reproduce. |
Loading "ng-file-upload.js" before loading "pace.js" fixed the issue for me. |
Same here, have been experiencing error: "XMLHttpRequest cannot load https://foreign_domain.tld/. Request header field _setXHR is not allowed by Access-Control-Allow-Headers in preflight response." |
I have the same problem and my dep are injected via gulp so...i create a small patch as describe in #832 Bower : pace-ng-file-upload-inlinepatch 0.0.6 |
Hi, how did you guys work out that it is was Pace.js ? I'm not using pace.js but I'm receiving this error, and trying to work out what is the conflict. |
When I try to upload a file, I get this error:
What I figured out is that
$upload
sets a fake header called__setXHR_
andangular-file-upload-shim
patches some methods to manage the fake header here:The problem is that
angular-file-upload-shim
conditionally executes most of its code:And at least in my browser (Chrome 40.0.2214.93 for Linux), window.FormData is set, and window.FileAPI is not, so the condition isn't met.
In summary:
Versions:
The text was updated successfully, but these errors were encountered: