Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploadify and HTTP 401 challenges. Why doesn't it work consistently?

Using Uploadify plugin which uses jQuery and SWF. Some web servers it works, some it does not. Seems to get a HTTP 401 Not Authorized when attempting to upload. Might be related to SWF. In Fiddler, when it does not work, seem to get this Proxy-Support: Session-Based-Authentication, but when it does work, we don't get the Session Based Authentication. Is this a network routing issue? Proxy Issue? Any suggestions on fix

HTTP/1.1 401 Unauthorized
Date: Mon, 22 Nov 2010 22:20:45 GMT
Server: Microsoft-IIS/6.0
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 1697

Proxy-Support: Session-Based-Authentication

like image 716
Shane Avatar asked Nov 22 '10 22:11

Shane


3 Answers

To anyone wanting to use the Uploadify plugin with Windows Authentication. Don't do it. Not just Uploadify, but any of them that use Flash files. Try another plug in instead. We used this one and it worked just great, no issues. It does not use any Flash.

http://valums.com/ajax-upload/

like image 199
Shane Avatar answered Nov 04 '22 12:11

Shane


Uploadify uses Flash for uploading. I think the problem here is related to a bug in Flash that makes Uploadify use a separate session. Even though the user's session is authorized to upload, that authorization is not extended to the Uploadify session.

One solution to this is issue is to make your own custom authentication for uploading. You could consider issuing a sort of access token to the user that can be passed as a parameter to Uploadify, and passed along when uploading files.

like image 31
Claus Asbjørn Sørensen Avatar answered Nov 04 '22 13:11

Claus Asbjørn Sørensen


I ran into this issue recently.

In my case I was using IIS with windows authentication enabled (no anonymous access). This prevented Flash from uploading files because it ran the upload process as a non-authenticated separate session. To resolve I allowed anonymous access on the handler files only and upload now works great.

like image 34
Jose G Avatar answered Nov 04 '22 12:11

Jose G