我希望能够在1Gb之前使用文件。继续得到错误,然后重试启动,百分比再次为0%并重新启动。 也没有预检OPTION请求。我甚至通过使用node-pluploader来处理块快速的NodeJS后端,但是那里有相同的问题和错误(尽管确实发送了预检OPTION)。
非常感谢任何建议
其他Apache指令
LimitRequestBody 0
PHP设置
file_uploads On
max_file_uploads 20
max_execution_time 3600
memory_limit 640M
post_max_size 600M
upload_max_filesize 500M
JS
var uploader = new plupload.Uploader({
runtimes : 'html5,silverlight,html4',
browse_button : 'pickfiles',
url : '<?php echo SITE_URL; ?>admin?sub=upload',
silverlight_xap_url : '<?php echo SITE_URL; ?>lib/Moxie.xap',
multi_selection : false,
max_retries: 10,
filters : {
max_file_size : '1024mb',
chunk_size: '10mb',
},
init: {
FilesAdded: function(up, files) {
plupload.each(files, function(file) {
$('#document-file').html(file.name);
});
},
UploadProgress: function(up, file) {
$('#spinner-progress').html( " " + file.percent + "%" );
},
Error: function(up, err) {
console.warn("Error #" + err.code + ": " + err.message);
},
UploadComplete: function(up, files) {
console.log(files[0]);
}
}
});
uploader.init();
上传者后端
<?php
require_once(LIB.SLASH."PluploadHandler.php");
PluploadHandler::no_cache_headers();
PluploadHandler::cors_headers();
if (!PluploadHandler::handle(array(
'tmp_dir' => UPL_TMP_PATH,
'target_dir' => UPL_TMP_PATH
))) {
die(json_encode(array(
'OK' => 0,
'error' => array(
'code' => PluploadHandler::get_error_code(),
'message' => PluploadHandler::get_error_message()
)
)));
} else {
die(json_encode(array('OK' => 1)));
}
我使用未更改的plupload-handler-php example
答案 0 :(得分:0)
原来是ngnix配置中的强制设置。 Plesk默认模板(default / domain / nginxDomainVirtualHost.php)强制client_max_body_size为128m。在推翻此设置时,Plesk返回了“重复”错误,最终将我转为this answer。制作自定义模板,更新虚拟主机。问题解决了!