Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
open-platform-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3c9f160d
authored
Dec 21, 2020
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改文件上传接口
1 parent
7873393f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
src/main/java/com/glsx/controller/FileController.java
src/main/java/com/glsx/controller/FileController.java
View file @
3c9f160
package
com
.
glsx
.
controller
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.util.ArrayList
;
import
java.util.List
;
import
cn.com.glsx.openplatform.enums.ResultCodeEnum
;
...
...
@@ -77,15 +75,10 @@ public class FileController {
@RequestMapping
(
value
=
"/uploadFile2"
,
method
=
{
RequestMethod
.
POST
})
public
Object
uploadFile2
()
{
byte
[]
bytes
;
try
{
bytes
=
Files
.
readAllBytes
(
Paths
.
get
(
"D:/Users/wbh/Desktop/glsx_car_service_sys_area.sql"
));
String
fileUrl
=
FdfsUtils
.
uploadFile
(
bytes
,
"sql"
);
System
.
out
.
println
(
fileUrl
);
return
R
.
ok
().
data
(
fileUrl
);
}
catch
(
IOException
e
)
{
throw
ResultCodeEnum
.
FILE_UPLOAD_ERROR
.
exception
();
}
bytes
=
new
byte
[]
{
65
,
10
};
String
fileUrl
=
FdfsUtils
.
uploadFile
(
bytes
,
"txt"
);
System
.
out
.
println
(
fileUrl
);
return
R
.
ok
().
data
(
fileUrl
);
}
/**
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment