Search code examples
jquerysymfonyjquery-file-uploadoneupuploaderbundle

Is there any default post_max_size in the jquery-file-upload plugin?


Is there any default max size of the file upload that is set in jquery-file-upload? I am asking this question since

  • I tried VichUploaderBundle and was I able to upload 4M-size files
  • I found that post_max_size = 8M in /etc/php5/apache2/php.ini

But, each time I use OneupUploaderBundle for files like 3 to 4M, I got in the javascript console.


Google Chromium

POST http://localhost/tuto/web/app_dev.php/_uploader/gallery/upload 500 (Internal Server Error) 

Firefox

POST http://localhost/tuto/web/app_dev.php/_uploader/gallery/upload [HTTP/1.0 500 Internal Server Error 90ms]

app/logs/dev.log

\ExceptionListener::onKernelException". [] []
[2014-10-21 21:24:53] request.CRITICAL: Uncaught PHP Exception Symfony\Component\HttpFoundation\File\Exception\FileException: "The file "another_ubuntu_wallpaper__raring_ringtail__by_360_graphics-d60693r.jpg" exceeds your upload_max_filesize ini directive (limit is 2048 kb)." at /home/amine/NetBeansProjects/tuto/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/UploadedFile.php line 251 {"exception":"[object] (Symfony\\Component\\HttpFoundation\\File\\Exception\\FileException: The file \"another_ubuntu_wallpaper__raring_ringtail__by_360_graphics-d60693r.jpg\" exceeds your upload_max_filesize ini directive (limit is 2048 kb). at /home/amine/NetBeansProjects/tuto/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/File/UploadedFile.php:251)"} []

Below is my code:

    $(function () {
        $('#fileupload').fileupload({
            dataType: 'json',
            done: function (e, data) {
                $.each(data.result.files, function (index, file) {
                    $('<p/>').text(file.name).appendTo(document.body);
                });
            }
        });
    });

Thank you for telling me how to set this max to 8M for example.


By the way, please add the tag OneupUploaderBundle to stackoverflow.com.


Solution

  • I have finaly found the solution.

    I have set also that param upload_max_filesize = 8M in addition to post_max_size = 8M in /etc/php5/apache2/php.ini

    Thank you @devsheeep for being helpful.