Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-micro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-micro
Commits
c8405500
Commit
c8405500
authored
Aug 28, 2020
by
周智鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传micro-api-flow专用上传文件的
parent
32696c91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
UploadManager.php
src/Manager/UploadManager.php
+3
-3
No files found.
src/Manager/UploadManager.php
View file @
c8405500
...
...
@@ -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
(
'文件保存失败'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment