0

I'm trying to use django-ajax-uploader in my website, which works just fine in LAN, but while I upload my file through internet, it only uploads a file of no more than 2MB, any file bigger than 2MB will fail.
I changed the default BUFFER_SIZE to 64MB but still did not work. And I have tested Chrome , Safari and Firefox, all failed.

Have any of you ever met this problem before? Thx :)

ps: I've seen this tip , but I'm quite sure it's a different case.

1 Answer 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.
Sign up to request clarification or add additional context in comments.

2 Comments

Its Nginx, but is it a buffer_size problem? I mean, while in LAN, uploading a much larger file is ok.
Default value of client_max_body_size for nginx is 1mb. Ngxinx drops all requests with body larger than this value. You could see this in log files. Look at wiki.nginx.org/HttpCoreModule#client_max_body_size for more details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.