jquery-file-upload插件中是否有默认的post_max_size?

时间:2014-10-20 16:50:35

标签: jquery symfony jquery-file-upload oneupuploaderbundle

jquery-file-upload中设置的文件上传是否有默认的最大大小?我问这个问题是

  • 我尝试VichUploaderBundle并且能够上传4M大小的文件
  • 我在post_max_size = 8M
  • 中找到/etc/php5/apache2/php.ini

但是,每次我使用OneupUploaderBundle来处理3到4M这样的文件时,我都进入了javascript控制台。


Google Chromium

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

火狐

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

应用/日志/ 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)"} []

以下是我的代码:

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

感谢您告诉我如何将此最大值设置为8M。


顺便提一下,请将标签OneupUploaderBundle添加到stackoverflow.com。

1 个答案:

答案 0 :(得分:2)

我终于找到了解决方案。

除了upload_max_filesize = 8M

中的post_max_size = 8M之外,我还设置了参数/etc/php5/apache2/php.ini

感谢@devsheeep的帮助。