Commit c8405500 authored by 周智鹏's avatar 周智鹏

上传micro-api-flow专用上传文件的

parent 32696c91
......@@ -146,13 +146,13 @@ class UploadManager
// 文件重命名,由当前日期时间 + 唯一ID + 扩展名
$fileName = date('YmdHis') . uniqid() . '.' . $extension;
$name = $file->toArray()['name'];
$savePath = self::parsePath($options, $documentRoot) . $fileName.'_'.$name;
$savePath = self::parsePath($options, $documentRoot) . $fileName;
$file->moveTo($savePath);
if ($file->isMoved()) {
if ($realPath) {
return $savePath;
return $savePath.'?'.$name;
} else {
return str_replace($documentRoot, '', $savePath);
return str_replace($documentRoot, '', $savePath.'?'.$name);
}
} else {
throw new HttpResponseException('文件保存失败');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment