4

I am using valums ajax-upload together with a ashx handler to let users upload files in the webapp Im developing. All is working absolutely fine for about 95% (around 3000) of the users.

For the last about 5% I get reports that the upload never finish, the wheel just keeps spinning people say. It seems that those who get this error are all are using IE9.0.

I have tested on all the IE9.0 I can come across but still have not been able to reproduce the error. I also have tried to log all thinkable errors but still no luck.

Please, can anyone reproduce the problem and hopefully give me a JavaScript console error transcript if any. To test go to step 2 (Upload section) and try to upload a small text file:

https://jobmatchprofile.com/backend/login.aspx?auto_login=24G3FY

UPDATE

I have been in contact with a user who experienced this problem. The error message can be seen here. It is in danish and says: "SCRIPT5 Access denied".

Error messageenter image description here

What is strange is that the user had same IE version as is working for others (me for example): I have been testing on: 9.0.8112.16421 and also ran WIN7 (as I). The Product-id differs however and he had a danish version where I have the US version.

UPDATE II

I was finally able to reproduce this error. I know this sounds a little strange, but belive me it is true: when opening the page via a link sent to my gmail account I get the same error. The user from first Update also used gmail to open the page.

Muleskinner
  • 14,150
  • 19
  • 58
  • 79
  • How did you manage to realize it's only IE problem? – kamil-mrzyglod Jan 17 '13 at 13:04
  • From user agent strings which I am logging for all users - from the 5-6 cases I have dug into all used IE. But you are right, it could be a coincidence – Muleskinner Jan 17 '13 at 13:07
  • And how about file size or situation when user cancels upload? – kamil-mrzyglod Jan 17 '13 at 13:19
  • max filesize is 4Mb for documents and 6Mb for images, appropriate warning messages are shown should the user try to upload larger files or files in unaccepted formats, all this should be working. But for users, for whom it fails, it also fails when they try to upload a small text file (1kb) - the ajaxwheel just keep spinning forever. – Muleskinner Jan 17 '13 at 13:37
  • Could confirm that you are not using `document.createElement(" – Mehdi Karamosly Jan 23 '13 at 22:27
  • Yes, I can confirm this. The script Im using (ajax-upload by valums) uses: `var iframe = toElement('');` – Muleskinner Jan 23 '13 at 22:48

3 Answers3

4

Your reference to Gmail, specifically, points in the direction of a solution: Gmail strips the referrer data from the HTTP headers when you click on a link within an e-mail, except when you use your right mouse button and select "Open in New Tab [or Window]", presumably because this prevents their code from intercepting the headers. Is your script checking for a valid HTTP REFERRER, by any chance?


Are you making any cross-(sub)domain or cross-protocol AJAX calls? If so, then you may have to proxy the request(s). Consider the following solutions from the Yahoo! Developer Network: http://developer.yahoo.com/javascript/howto-proxy.html

See also:

(Un)fortunately, I wasn't able to reproduce the error in IE9, v. 9.0.8112.16421 (although I did get a general on-site error when trying to upload an empty .txt file, but this seems wholly unrelated).

Community
  • 1
  • 1
redburn
  • 542
  • 4
  • 24
  • Thanks a lot for your answer - I can reproduce the error myself now, see UPDATE II in my question. Will look into your links. – Muleskinner Jan 22 '13 at 20:43
  • I forgot: No cross domain or cross protocol ajax calls. I can even reproduce it here [http://jsfiddle.net/Claudius/q4b6k/15/](http://jsfiddle.net/Claudius/q4b6k/15/) To reproduce, send the jsfiddle link to a gmail account and click on the link in gmail using IE9.0 - it will throw the error (check javascript console)! Other browsers dont throw the error and linking from other pages (like SO) using IE9.0 also works – Muleskinner Jan 22 '13 at 21:06
  • I've updated my answer. Your reference to Gmail gave it away (I missed your 2nd update on my first reading). – redburn Jan 22 '13 at 21:24
  • Thanks, this could be very interesting. I am not aware that the script uses the referrer header. But it does dynamically create forms and iframes, so referrer could be used indirectly somehow maybe. But one thing troubles me: when clicking the link from Gmail you go to a overview page on my webapp. From this overview page you click on another link to go to the file-upload page (on same domain). It is on the file-upload page the script error is thrown. Then, even if Gmail strip referrer, would my file-upload page not have a valid referrer set (ie to the overview page of my webapp)? – Muleskinner Jan 22 '13 at 23:24
  • Your file-upload page would, absolutely, but it's your "Overview" page that creates the session. Have you tried updating your scripts to the latest versions? You're using jQuery 1.6.1 when 1.9.0 is the current release. – redburn Jan 23 '13 at 06:49
  • I realize your jsfiddle uses the latest jQuery release, but I can't seem to reproduce the error there, following the steps you described. – redburn Jan 23 '13 at 07:07
  • Did try to upgrade the page to 1.9.0, unfortunately still same error. For now my workaround solution is to browser-detect IE9.0 and if true then add `target="_blank"` to the link to the upload page. Not very polite to all IE9.0 users - especially not polite to those who did not come from Gmail - but at least now all can now upload. – Muleskinner Jan 23 '13 at 22:51
0

Even though you are sure that it's related to the user clicking the anchor within the email I would say it's because of policy settings within Internet Explorer. I have seen errors like these before and noticed that the most common errors were related to Internet Explorer policies of users within a corporate environment.

Robert
  • 68
  • 5
  • It is a fact that 1) accessing the upload page via a link from Gmail using IE9.0 will give the error 2) accessing the upload page by clicking the link elsewhere (like here at SO) or manually typing it in the address bar of the browser will not give the error (same browser, same computer, same location). Also: the users, who reported the problem and whom I have examined (5-7 users), all used IE9.0 AND had provided a gmail account as contact mail. So I am pretty sure this is somehow a strange combination of IE9.0 and Gmail even though I agree it almost sound too strange to be true – Muleskinner Jan 22 '13 at 21:16
  • And: CTRL+Click (or left-click -> open link in new tab) from Gmail will not give the error where as normal click will. – Muleskinner Jan 22 '13 at 21:19
0

The solution for ie9 is simply to upload using https:

https://www.parse.com/questions/internet-explorer-and-the-javascript-sdk

Mehdi Karamosly
  • 5,388
  • 2
  • 32
  • 50