【发布时间】:2011-09-02 22:13:48
【问题描述】:
我在尝试使用 django-filebrowser(使用 uploadify)上传文件时收到“IO 错误”。
我应该澄清一下,这不起作用的唯一情况是在 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 - 用户 [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(并且以老式方式上传文件没有任何问题)。
请帮忙!
【问题讨论】: