-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
IE9 Post just hangs in there, does not return anything #163
Comments
Yes read the Old Browsers section of the README and follow the instructions. |
Hi Danial, I have the same issue and I can't pinpoint the error. It just doesn't give me any feedback. I have both FileAPI.min.js and FileAPI.flash.swf loaded (they're in the same folder as angular-file-upload.min.js). I've also loaded angular-file-upload-shim.min.js before angular.js and angular-file-upload.min.js. I still get no console output or browser reaction when calling $upload.upload(). Any suggestions where I might look for an error or solution? Thanks! |
I just noticed a typo in the bundled version of FileAPI.min.js, at line 24: chunkUpoloadRetry instead of chunkUploadRetry I'm not sure if it affects anything, since the online demo has it too, and it works fine in IE9. I'm still trying to figure out why it won't upload. I've traced the issue to xhr.__fileApiXHR = FileAPI.upload(config); (line 127 in angular-file-upload-shim.js, but I'm not sure what inside FileAPI.upload is silently failing. |
I have the same problem. I realized that my server responds with 403 and that the CSRF header, that I define in $upload.upload, is not present anymore in this config variable: xhr.__fileApiXHR = FileAPI.upload(config); It's really just a step in the dark but could that be the problem? |
If the Demo page is working for you then the problem is either in your code or the way you customize the plugin. For IE9 Flash should be loaded in place of browse button, one easy way to test it is if you right click on the button it should show the Flash context menu. Flash has this limitation for setting custom headers, so CSRF headers will not be set for IE8-9. You can workaround this issue to send them as the request data for these browsers or prompt the user that they are using old browser and there are security risks associated with it. If you couldn't figure it out you can post your html and js code here or create a jsfiddle. |
I'll try to post some code and give some context. Flash is loaded in place of the browse button (right-click brings the context menu), and I'm not currently using CSRF headers. Unlike basilikum, my server never receives a request from the client. Coffeescript:
|
Not sure if it makes a difference, but I'm also loading https://github.com/es-shims/es5-shim on the same page. |
Thanks danial, sending the token with the request data did it for me. |
@andreipopovici |
And yes |
es5-shim is loaded first, before anything else. It turns out it wasn't even loading on IE9 due to a conditional comment. The HTML is too complicated to explain and post, since it does a bunch of things, including PDF previews using pdf.js (on anything higher than IE9, of course). I'll try an iframe-based solution for IE9 only, and will revisit this when I get more time. I can post the includes at the bottom of the HTML, though:
|
So what's the error message you get in the console? Here is the point that it sends the data to the FileAPI plugin. If it fails there there should be an error code. Also make sure that you are using the exact same version of FileAPI that is provided with this plugin (do not include FileAPI in the script tag) |
The screenshot below shows the argument sent to FileAPI.upload (so it's the content of config). I'm not including FileAPI.min.js in the HTML, it comes from the shim. By the way, there's a typo in the provided version, do a search for chunkUpoloadRetry. Not sure it has anything to do with the current error. It never fails anywhere, no errors show up in the console at all, not even from FileAPI's
the contents of Stepping through never raises any other console error, it just silently moves forward. I can't figure out where in the upload process it fails and why. It's clearly on my side, since your demo works fine in the same browser. |
Can you use non-minified version of FileAPI from here: https://raw.githubusercontent.com/danialfarid/angular-file-upload/master/demo/war/js/FileAPI.js Just replace it with FileAPI.min.js in your bower_components. This will give you a better clue what variable is excepted to be Object but it is not. |
It wasn't loading the Flash file at first, because And when it loads the Flash object, it's a child of However, the If I can't find out why the success promise never fulfills, I'll just have to go with a front-end hack to show feedback in IE9 only. Thank you for the unminified version! |
Hi Danial, just a follow-up question. I still can't figure out why the Flash object isn't correctly nested under the My question is: did you change anything between the un-minified and minified versions? Specifically, the code that seems to get called from FileAPI.min.js is:
Afterwards, the
Here's the relevant part from the HTML:
That's the only file input in the entire HTML. It's nested under a container div:
|
I wanted to thank you again for all your help so far, and for writing the service! Sorry for being a pain :) |
The version of non-minified FileAPI is different. |
I don't think wrapping your input in an There should be an
|
Hmm, that might have been a good idea. I ultimately brute-forced it by giving the I'm now tackling the next issues: progress is not updating properly (I see from the demo code that there's a conditional for IE reporting 200% progress, I'll go ahead and do that too), and the success callback never gets called. |
Hello Andrei! I ran into the same problems you described and after fixing the 'upoload'-typo got it working to the point where the upload via flash happens, but the success callback is not called, only some progress events get fired. Did you find out, why the callback does not get called? |
I did not find out why, but the un-minified version of the FileAPI.js script seemed to solve the issue. |
I'm using minified version of FileAPI.js provided within angular-file-upload module. I ended up in the situation of the uploading freezing only when the file is uploaded properly. I have discovered that this only happens when the response status is 200 and the response text is empty. If a fill in the response text, everything works fine. Hope this helps you all ! |
@albitxu If that only happens for IE8-9 that's a flash bug/limitation. There need to be a response body coming back. @andreipopovici @pkreuzinger Is there any outstanding issue or possible fix that could be done left here or can I close this issue? |
Well we didn't figure out yet why it works with the un-minified version (at least in my situation), but if you could replace the minified with the un-minified (and let users minify at will using something like Grunt or Gulp), then I vote for closing. |
Fixing the mentioned typo and returning a non empty response worked for me. Maybe mention that flash limitation in the readme/old browsers section.
|
This took me a few days to figure out, but I think I know what's wrong. As for where the problem lies, if you checkout the Gruntfile and this directory and peep the commit logs, you'll see that the minified version is 3 months older than the non-minified one (and presumably missing the fix for #122 which is when FileAPI.js was updated). If I have time tomorrow, I'll submit a PR to remedy the problem I described. Long story short is we need to fix the build process so only one copy of FileAPI is used as the source. |
These are fixed in version 1.4.0 and note has been added to README file for the flash bug. Reopen if you are still having problem. |
Seems like the success promise never fire problem persists, I set response text to not be empty, although file is uploaded, client is hanging and never receive answer from server |
The FileAPI version is switched to newer version since 1.5.x. |
When calling the function $rootScope.upload = $upload.upload({...}); nothing is happening, this is the last line i can log in my console.
Whilst in Chrome/Firefox it uploads perfectly. It's like it won't find my url to post to, but when i change it to a wrong one, it still does not do anything.
Am i missing something specific for IE?
The text was updated successfully, but these errors were encountered: