im使用plupload和php类调整http://www.verot.net/php_class_upload_docs.htm大小
一切正常,但是当我上传大文件4000x2000px时,只有250kb,上传失败。resize的类有它的最大宽度和高度的限制,但它被设置为NULL,所以它不会检查它是否导致取消上传。
我在AJAX处理程序中的代码是这样的。
$foo = new Upload($_FILES['file']);
if ($foo->uploaded)
{
$new_name = functions::getRandomString(16);
$foo->file_new_name_body = 'b_' . $new_name;
if ($foo->image_src_x > 800 or $foo->image_src_y > 600)
{
$foo->image_resize = true;
$foo->image_ratio = true;
$foo->image_y = 600;
$foo->image_x = 800;
}
$foo->image_convert = 'png';
$foo->Process($upload_path);
if ($foo->processed)
{
//echo 'image renamed "foo" copied';
}
else
{
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Chyba prejmenovani."}, "id" : "id"}');
}和jquery
$("#uploader").pluploadQueue({
// General settings
runtimes : 'html5,html4',
url : '/core/ajax/ajax_upload.php',
max_file_size : '10mb',
chunk_size : '5mb',
unique_names : true,
/*
resize : {width : 320, height : 240, quality : 90},
*/
// Specify what files to browse for
filters : [
{
title : "Image files",
extensions : "jpg,jpeg,gif,png"
}]
});以及这个具体文件上载会话的JSON响应
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,发布于 2012-12-26 12:56:55
PHP配置可能会限制文件大小,请尝试查看Apache错误日志以查看确切的问题。
或
您还可以使用<?php phpinfo(); ?>查看最大上传文件大小
发布于 2012-12-27 09:19:46
我将此虚拟主机的值更改为10000000,并重新启动了服务器。而且它似乎是固定的。谢谢你帮我检查错误日志。
https://stackoverflow.com/questions/14036136
复制相似问题