Search code examples
ajaxdjangouploaderajaxuploader

Big file upload failure using django-ajax-uploader


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.


Solution

  • 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.