Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
haoban3.0
haoban-manage3.0
Commits
3b9cdcb8
Commit
3b9cdcb8
authored
Sep 01, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:上传文件名字修改
parent
4be19ace
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
UploadController.java
...om/gic/haoban/manage/web/controller/UploadController.java
+2
-3
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/UploadController.java
View file @
3b9cdcb8
...
...
@@ -49,15 +49,14 @@ public class UploadController extends WebBaseController {
String
suffix
=
name
.
substring
(
name
.
lastIndexOf
(
"."
)
+
1
);
name
=
SecureUtil
.
md5
(
name
)
+
"."
+
suffix
;
String
location
=
System
.
getProperty
(
"user.dir"
)
+
"/data/tmp/"
;
//b
long
len
=
file
.
getSize
();
File
templateFile
=
new
File
(
location
+
name
);
FileUtils
.
copyInputStreamToFile
(
file
.
getInputStream
(),
templateFile
);
// 2.上传腾讯云
String
dayFilePath
=
LocalDateTime
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
DateUtil
.
FORMAT_DATETIME_14
));
String
key
=
"haoban/"
+
dayFilePath
+
"/"
+
mediaName
;
String
nameUpload
=
mediaName
+
"."
+
suffix
;
String
key
=
"haoban/"
+
dayFilePath
+
"/"
+
nameUpload
;
fileType
=
FILE_TYPE
.
contains
(
fileType
)
?
fileType
:
BucketNameEnum
.
OTHER_90000
.
getName
();
try
{
String
url
=
FileUploadUtil
.
simpleUploadFileFromLocal
(
templateFile
,
key
,
fileType
);
...
...
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