我有一个 Django 应用程序,可以接受来自以下位置的上传jQuery 上传 http://www.uploadify.com/,一个jQ插件,使用flash上传文件并给出进度条。
大约 150k 以下的文件可以工作,但更大的文件总是会失败,并且几乎总是在 192k 左右(即 3 个块)完成,有时在 160k 左右。我得到的异常如下。
exceptions.IOError
request data read error
File "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py", line 171, in _get_post
self._load_post_and_files()
File "/usr/lib/python2.4/site-packages/django/core/handlers/wsgi.py", line 137, in _load_post_and_files
self._post, self._files = self.parse_file_upload(self.META, self.environ[\'wsgi.input\'])
File "/usr/lib/python2.4/site-packages/django/http/__init__.py", line 124, in parse_file_upload
return parser.parse()
File "/usr/lib/python2.4/site-packages/django/http/multipartparser.py", line 192, in parse
for chunk in field_stream:
File "/usr/lib/python2.4/site-packages/django/http/multipartparser.py", line 314, in next
output = self._producer.next()
File "/usr/lib/python2.4/site-packages/django/http/multipartparser.py", line 468, in next
for bytes in stream:
File "/usr/lib/python2.4/site-packages/django/http/multipartparser.py", line 314, in next
output = self._producer.next()
File "/usr/lib/python2.4/site-packages/django/http/multipartparser.py", line 375, in next
data = self.flo.read(self.chunk_size)
File "/usr/lib/python2.4/site-packages/django/http/multipartparser.py", line 405, in read
return self._file.read(num_bytes)
当在 Django 开发服务器上本地运行时,大文件可以工作。
我尝试过设置我的FILE_UPLOAD_HANDLERS = ("django.core.files.uploadhandler.TemporaryFileUploadHandler",)
万一它是内存上传处理程序,但这没有什么区别。
有谁知道如何解决这一问题?