0

我正在尝试django-ajax-uploader在我的网站中使用,它在局域网中运行良好,但是当我通过互联网上传文件时,它只上传不超过 2MB 的文件,任何大于 2MB 的文件都会失败。
我将默认的BUFFER_SIZE更改为 64MB,但仍然无法正常工作。而且我测试过 Chrome、Safari 和 Firefox,都失败了。

你们中有人遇到过这个问题吗?谢谢 :)

ps:我看过这个提示,但我很确定这是一个不同的情况。

4

1 回答 1

1

What frontend server do you use (Apache, nginx)? You need to check it settings.

EDIT: If you're using nginx you need something like this:

server {
        listen   80;
        server_name example.com;

        client_max_body_size    64m;
}

For apache something like so:

upload_max_filesize = 64M
post_max_size = 64M

You could check that the problem is with the frontend server by:

  1. run ./manage.py runserver 0.0.0.0:8000 on production server - this runs 'developer' server on port 8000 and allows to connect from your computer
  2. go to yourdoamin.com:8000 and try to upload a large file. It should work fine.
于 2012-07-24T08:33:32.337 回答