是否设置了文件上传的默认最大大小jquery-file-upload
?我问这个问题是因为
- 我尝试了 VichUploaderBundle并且能够上传 4M 大小的文件
- 我发现
post_max_size = 8M
在/etc/php5/apache2/php.ini
但是,每次我将OneupUploaderBundle用于 3 到 4M 之类的文件时,我都会进入 javascript 控制台。
谷歌铬
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。