优化文件上传
This commit is contained in:
parent
114ba0d14d
commit
bcb568f2a9
@ -6,6 +6,7 @@ use app\common\Model\Member;
|
|||||||
use controller\BasicApi;
|
use controller\BasicApi;
|
||||||
use service\FileService;
|
use service\FileService;
|
||||||
use think\Exception;
|
use think\Exception;
|
||||||
|
use think\facade\Log;
|
||||||
use think\facade\Request;
|
use think\facade\Request;
|
||||||
|
|
||||||
|
|
||||||
@ -116,11 +117,15 @@ class File extends BasicApi
|
|||||||
$ext = explode('.', $orgFileName);
|
$ext = explode('.', $orgFileName);
|
||||||
$ext = $ext[count($ext) - 1];
|
$ext = $ext[count($ext) - 1];
|
||||||
$fileUrl = "{$path}/{$fileName}-{$i}.{$ext}";
|
$fileUrl = "{$path}/{$fileName}-{$i}.{$ext}";
|
||||||
|
|
||||||
|
// logRecord(['url' => $fileUrl], 'info', 'temp/uploadFiles');
|
||||||
$site_url = FileService::getFileUrl($fileUrl, 'local');
|
$site_url = FileService::getFileUrl($fileUrl, 'local');
|
||||||
$blob = file_get_contents($site_url);
|
if ($site_url) {
|
||||||
|
$blob = file_get_contents($site_url);
|
||||||
// $blob .= file_get_contents($site_url);
|
// $blob .= file_get_contents($site_url);
|
||||||
$fileList[] = env('root_path') . $fileUrl;
|
$fileList[] = env('root_path') . $fileUrl;
|
||||||
$result = FileService::$type($path2, $blob, true);
|
$result = FileService::$type($path2, $blob, true);
|
||||||
|
}
|
||||||
unset($blob);
|
unset($blob);
|
||||||
unset($site_url);
|
unset($site_url);
|
||||||
unset($fileUrl);
|
unset($fileUrl);
|
||||||
|
@ -49,7 +49,7 @@ return [
|
|||||||
// Query类
|
// Query类
|
||||||
'query' => '\\think\\db\\Query',
|
'query' => '\\think\\db\\Query',
|
||||||
// 是否需要断线重连
|
// 是否需要断线重连
|
||||||
'break_reconnect' => false,
|
'break_reconnect' => true,
|
||||||
// 断线标识字符串
|
// 断线标识字符串
|
||||||
'break_match_str' => [],
|
'break_match_str' => [],
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user