我在使用django-filebrowser(使用uploadify)试图上传文件时遇到'IO ERROR'。Uploadify IO错误(django-filebrowser)
我应该澄清,这种情况不起作用的唯一情况是在OSX上使用Firefox 4时。在Windows上工作的IE8。
另外,它在使用本地开发服务器时也可以与Firefox一起使用。
我还应该注意到,我在uplodify自己的网站演示中得到了这个确切的错误。
这是我从Wireshark的看到:
POST /djadmin/filebrowser/check_file/ HTTP/1.1
Host: xxx
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Accept: application/json, text/javascript, */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: xxx
Content-Length: 57
Cookie: csrftoken=xxx sessionid=xxx
Authorization: Basic xxx
Pragma: no-cache
Cache-Control: no-cache
UPBWID=fd.png&folder=%2Fdjadmin%2Ffilebrowser%2Fupload%2FHTTP/1.1 200 OK
Date: Thu, 26 May 2011 20:08:30 GMT
Server: Apache/2.2.9
Vary: Accept-Language,Cookie
Content-Language: el
Content-Length: 2
Connection: close
Content-Type: text/html; charset=utf-8
{}
据我所知,一个返回值{}就可以了。
这是我从Apache获得的唯一输出: xxx - user [26/May/2011:20:08:30 +0000]“POST/djadmin/filebrowser/check_file/HTTP/1.1”200 2“xxx/djadmin/filebrowser/upload /“”Mozilla/5.0(Macintosh; Intel Mac OS X 10.6; rv:2.0.1)Gecko/20100101 Firefox/4.0.1“
我可以看到很多人都在遇到同样的问题。 通常归咎于mod_security,mod_wsgi和浏览器/ flash插件的模糊不兼容。
我是不是正在运行mod_security。 我正在使用mod_wsgi运行django(并且没有任何上传文件的麻烦)。
请帮忙!
在我的文章中显示的check_file函数已经使用了csrf_exempt装饰器。 – Dim 2011-05-26 21:02:36