提交 0290d00f 编写于 作者: D devil_gong

附件上传组件改为单线程

上级 5443d13f
...@@ -107,6 +107,12 @@ class Uploader ...@@ -107,6 +107,12 @@ class Uploader
*/ */
private function uploadFile() private function uploadFile()
{ {
if(empty($_FILES[$this->fileField]))
{
$this->stateInfo = $this->getStateInfo("ERROR_SIZE_EXCEED");
return;
}
$file = $this->file = $_FILES[$this->fileField]; $file = $this->file = $_FILES[$this->fileField];
if (!$file) { if (!$file) {
$this->stateInfo = $this->getStateInfo("ERROR_FILE_NOT_FOUND"); $this->stateInfo = $this->getStateInfo("ERROR_FILE_NOT_FOUND");
......
...@@ -176,7 +176,8 @@ ...@@ -176,7 +176,8 @@
fileVal: editor.getOpt('fileFieldName'), fileVal: editor.getOpt('fileFieldName'),
duplicate: true, duplicate: true,
fileSingleSizeLimit: fileMaxSize, fileSingleSizeLimit: fileMaxSize,
compress: false compress: false,
threads: 1
}); });
uploader.addButton({ uploader.addButton({
id: '#filePickerBlock' id: '#filePickerBlock'
......
...@@ -348,6 +348,7 @@ ...@@ -348,6 +348,7 @@
server: actionUrl, server: actionUrl,
fileVal: editor.getOpt('imageFieldName'), fileVal: editor.getOpt('imageFieldName'),
duplicate: true, duplicate: true,
threads: 1,
fileSingleSizeLimit: imageMaxSize, // 默认 2 M fileSingleSizeLimit: imageMaxSize, // 默认 2 M
compress: editor.getOpt('imageCompressEnable') ? { compress: editor.getOpt('imageCompressEnable') ? {
width: imageCompressBorder, width: imageCompressBorder,
......
...@@ -625,7 +625,8 @@ ...@@ -625,7 +625,8 @@
fileVal: editor.getOpt('videoFieldName'), fileVal: editor.getOpt('videoFieldName'),
duplicate: true, duplicate: true,
fileSingleSizeLimit: fileMaxSize, fileSingleSizeLimit: fileMaxSize,
compress: false compress: false,
threads: 1
}); });
uploader.addButton({ uploader.addButton({
id: '#filePickerBlock' id: '#filePickerBlock'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册