mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-11-01 07:20:56 +00:00
提交文件上传提示文字
This commit is contained in:
parent
7416ff1a97
commit
52f7140be1
@ -126,17 +126,17 @@ class Cos extends BaseUpload
|
||||
if (!$isStream) {
|
||||
$fileHandle = app()->request->file($file);
|
||||
if (!$fileHandle) {
|
||||
return $this->setError('Upload file does not exist');
|
||||
return $this->setError('上传的文件不存在');
|
||||
}
|
||||
if ($this->validate) {
|
||||
if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
|
||||
return $this->setError('Upload fileExt error');
|
||||
return $this->setError('不合法的文件后缀');
|
||||
}
|
||||
if (filesize($fileHandle) > $this->validate['filesize']) {
|
||||
return $this->setError('Upload filesize error');
|
||||
return $this->setError('文件过大');
|
||||
}
|
||||
if (!in_array($fileHandle->getOriginalMime(), $this->validate['fileMime'])) {
|
||||
return $this->setError('Upload fileMine error');
|
||||
return $this->setError('不合法的文件类型');
|
||||
}
|
||||
}
|
||||
$key = $this->saveFileName($fileHandle->getRealPath(), $fileHandle->getOriginalExtension());
|
||||
|
||||
@ -113,17 +113,17 @@ class Local extends BaseUpload
|
||||
{
|
||||
$fileHandle = app()->request->file($file);
|
||||
if (!$fileHandle) {
|
||||
return $this->setError('Upload file does not exist');
|
||||
return $this->setError('上传的文件不存在');
|
||||
}
|
||||
if ($this->validate) {
|
||||
if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
|
||||
return $this->setError('Upload fileExt error');
|
||||
return $this->setError('不合法的文件后缀');
|
||||
}
|
||||
if (filesize($fileHandle) > $this->validate['filesize']) {
|
||||
return $this->setError('Upload filesize error');
|
||||
return $this->setError('文件过大');
|
||||
}
|
||||
if (!in_array($fileHandle->getOriginalMime(), $this->validate['fileMime'])) {
|
||||
return $this->setError('Upload fileMine error');
|
||||
return $this->setError('不合法的文件类型');
|
||||
}
|
||||
}
|
||||
if ($realName) {
|
||||
|
||||
@ -121,17 +121,17 @@ class Oss extends BaseUpload
|
||||
{
|
||||
$fileHandle = app()->request->file($file);
|
||||
if (!$fileHandle) {
|
||||
return $this->setError('Upload file does not exist');
|
||||
return $this->setError('上传的文件不存在');
|
||||
}
|
||||
if ($this->validate) {
|
||||
if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
|
||||
return $this->setError('Upload fileExt error');
|
||||
return $this->setError('不合法的文件后缀');
|
||||
}
|
||||
if (filesize($fileHandle) > $this->validate['filesize']) {
|
||||
return $this->setError('Upload filesize error');
|
||||
return $this->setError('文件过大');
|
||||
}
|
||||
if (!in_array($fileHandle->getOriginalMime(), $this->validate['fileMime'])) {
|
||||
return $this->setError('Upload fileMine error');
|
||||
return $this->setError('不合法的文件类型');
|
||||
}
|
||||
}
|
||||
$key = $this->saveFileName($fileHandle->getRealPath(), $fileHandle->getOriginalExtension());
|
||||
|
||||
@ -117,17 +117,17 @@ class Qiniu extends BaseUpload
|
||||
{
|
||||
$fileHandle = app()->request->file($file);
|
||||
if (!$fileHandle) {
|
||||
return $this->setError('Upload file does not exist');
|
||||
return $this->setError('上传的文件不存在');
|
||||
}
|
||||
if ($this->validate) {
|
||||
if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
|
||||
return $this->setError('Upload fileExt error');
|
||||
return $this->setError('不合法的文件后缀');
|
||||
}
|
||||
if (filesize($fileHandle) > $this->validate['filesize']) {
|
||||
return $this->setError('Upload filesize error');
|
||||
return $this->setError('文件过大');
|
||||
}
|
||||
if (!in_array($fileHandle->getOriginalMime(), $this->validate['fileMime'])) {
|
||||
return $this->setError('Upload fileMine error');
|
||||
return $this->setError('不合法的文件类型');
|
||||
}
|
||||
}
|
||||
$key = $this->saveFileName($fileHandle->getRealPath(), $fileHandle->getOriginalExtension());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user