-
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
IE8 select called twice, callback not triggered sometimes #1071
Comments
Demo page is working fine on IE8 WinXP for me. |
I tried on a native IE version 8.0.7601.17514 on windows7 with Flash version 19,0,0,207 on a modern.ie vm and it doesn't work at all. I can select a file through the flash object, but then nothing happens. If I try on a IE11 in compatibility mode IE8, I get an error in FileAPI on "console.log.apply" as soon as the page loads. When I try a local implementation with the latest FileAPI.js in that same setup, I get the "invalid argument" error. For most of the tests, I'm using modern.ie virtualbox images provided by microsoft for testing, and didn't install any plugin except Flash itself. I'm a bit surprised that it would work for you. Could please test with a clean VM from https://dev.modern.ie/tools/vms/mac/ ? |
Just tested on a fresh copy everything works fine on the demo page. |
@danialfarid: I tried 4 different versions of IE8 on 2 different computers and locations/networks, all with a different version of Flash and with the same result. I'm positive flash is properly activated on them, as I saw the animation on the Adobe page after installing. Here is what I have in the console:
Are you testing locally or on https://angular-file-upload.appspot.com/ ? |
I tested https://angular-file-upload.appspot.com/. It was a fresh install. |
Tests with a native IE8 (8.0.6001.18702) on winXP (Pro SP3) with Flash 12.0.0.38:
On http://1-6-10.angular-file-upload.appspot.com/ the file size is detected, but progress bar stays at 0%
|
So what's the error log or console output you get for the latest demo page? |
It seems the fileAPI repository didn't release the fix yet, so in order to try from current site you'd need to remove the debug:true that is causing the scripts to fail |
But do you get the same error in IE8? |
@mlarcher Could you verify if it is fixed now |
I don't have the debugger console taking over in IE10 compat mode anymore, but I still have the errors in the console and a non functionnal demo page. |
hmm well i fixed that line that you mentioned in the post. |
Could it be still cashing the old version? |
I made the demo to use nonminified version of the FileAPI so you can pin down where the error is. |
@danialfarid here is a few screenshot highlighting where IE10 in compat mode IE8 chokes (sorry the error messages are in french, I couldn't find how to change that). Hopefully it will get you an idea on how to tackle the issue. |
I think the culprit is Object.defineProperty (cf https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#Browser_compatibility ) |
I made a fix for that Object.defineProperty on the demo page, could you test again. |
It seems you forgot to decalre the _supportConsoleLog and _supportConsoleLogApply variables when you applied the fix in FileAPI. Why not just npm install it ? The fix is already in the master branch. |
Does the upload work? |
I made some changes to get rid of that error. |
Could you make sure you haven't change the html code in IE8, click on edit html link and then click on reset to default. Also FYI the plugin only works with the fileapi version that is shipped with this plugin. Other versions of fileapi may not work. |
Does it hit https://github.com/danialfarid/ng-file-upload/blob/master/dist/ng-file-upload-shim.js#L97 when you click submit? |
nope. |
Can you put a breakpoint here: https://github.com/danialfarid/ng-file-upload/blob/master/dist/ng-file-upload.js#L292 |
Actually placing a breakpoint there doesn't lead to the line creating the error as far as I can tell. I've recorded the screen on video in case you can get some relevant info out if it. It is available on http://ringabell.org/temp/screen1.mp4 |
After deeper investigation, it appears that the error resides in https://github.com/danialfarid/ng-file-upload/blob/master/dist/ng-file-upload-shim.js#L90 where orig doesn't have an If I evaluate This error happens in a try/catch block in angular (cf https://github.com/angular/code.angularjs.org/blob/master/1.2.24/angular.js#L11574 ) hence the "unspecified error" output. |
Alright we are getting closer. Also could you see the network tab and see if there is any OPTIONS request being sent to the server? |
Also could you see if normal angular http works in your browser? |
I can confirm that About the angular code, I don't see how I can be any more specific than I've already been in my previous meassage. For the options request, I don't see any, but afaik only Chrome shows preflight requests in the network tab. On xhr, I'm not sure I ever come to a place in the code where it is defined atm. How can I check that ? |
hmm so if the angular's $http is not working then this is an angular issue. Can you change the version of the angular on top right side of the page to a different one, earlier or later and see if it works with any of the angular versions. You can open an issue on angular github. |
@danialfarid: this is not an angular issue, as the code throwing the error resides in ng-file-upload-shim ( https://github.com/danialfarid/ng-file-upload/blob/master/dist/ng-file-upload-shim.js#L90 ). I'm just saying that making a post request through $http the way I pasted above ends up in the problematic code in ng-file-upload-shim being called. |
Right, Can you put a breakpoint where the apply on setRequestHeader is called and see if |
So, now I'm sur that the original reference to You can check the following screenshot for more details. |
Would it work if you call in the console |
It doesn't :( |
I have WinXP SP3, IE8.0.60001.18702 and I tried on the virtual box instance you posted earlier with Win7 IE8. Can you somehow make a clone of the vm that is not working and send it to me? |
From the screenshot above I can see that origin is actually an object not a function. |
I replaced Also, as I removed the orig.apply() call, I saw that the upload became functional, reporting progress and eventually displaying "Upload Succesful". Of course, that would be without the headers, but that's something. For the VM, I used several environments, one of them being the same VM you tried (to be confirmed). I'll make sure it was on a WinXP SP3 with the same version you have. |
Hi @danialfarid , I have just tested again the demo site in a virtualbox, and found it working! Weird thing is that it still fails in the vmware box, but well, if it can work in a ie8 in a vm, I can assume a native one on a real OS should work too. I updated the code on our application with the latest version of ng-file-upload (plus shim and fileapi), and got the following problems, though:
Could you please have a look at those ? |
also, and even on the demo site, the second upload will fail because there is no prevFiles. I believe it is due to the same reason: promise being never resolved, the prevfiles would not be filled. |
@danialfarid : any news on the matter ? |
For number 1 do you use jquery? If you remove jquery dependency would it work? I wanna make sure it is related to jquery. It could be because upload will be called when you click on the element since it is reseting the previous files, so it might be the reason it is being called twice. For number 2 make sure your server returns something. If the response doesn't have content or it is 400 error code Flash will not fire request complete. |
We don't use jQuery at all, and the server returns a json object on upload completion. |
So why do you think it is related to #284? |
I think it may be related to #284 because it fixed the same issue (File select callback is called twice in IE8) on the same project when I opened it at the time. Might be another issue with the same symptoms, though. When placing a breakpoint where you said, I see the expected output from the server. It's hard to figure out what's going on next, as there are many jumps into angular and other scripts. Do you have something more specific to test ? |
The fix for #284 is just an if condition for the case jquery is available. so I don't think the same fix would help here. If you get the response back correctly from the server then everything should be fine. |
i also have this problem, ie 11 with compatible mode ie9. win10 64. |
Demo page is not working in IE8, and I can't get it to work locally either.
There is an issue with console.log.apply in FileAPI when debug mode is set to true (cf https://github.com/mailru/FileAPI/issues/353 ) which block anything else on the demo page.
When this is fixed (or when debug is false), there is an "Error: Invalid argument." with stack
[object Error]{description: "Invalid argument", message: "Invalid argument", name: "Error", number: -2147024809}
.I couldn't figure out where this one was coming from.
The text was updated successfully, but these errors were encountered: