Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ry-exchange
Project
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
王金锋
ry-exchange
Commits
ab7fd7b3
Commit
ab7fd7b3
authored
Mar 21, 2018
by
wangjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
908c2d14
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
28 deletions
+2
-28
FileUploadConfiguration.java
.../com/reyun/dmp/configuration/FileUploadConfiguration.java
+2
-28
No files found.
src/main/java/com/reyun/dmp/configuration/FileUploadConfiguration.java
View file @
ab7fd7b3
package
com
.
reyun
.
dmp
.
configuration
;
import
javax.servlet.MultipartConfigElement
;
import
org.springframework.boot.web.servlet.MultipartConfigFactory
;
import
org.springframework.context.annotation.Bean
;
/**
* 文件上传配置
*
* @author wangjf
* @date 2018年03月21日15:15:20
*/
public
class
FileUploadConfiguration
{
@Bean
public
MultipartConfigElement
multipartConfigElement
()
{
MultipartConfigFactory
factory
=
new
MultipartConfigFactory
();
// 设置文件大小限制 ,超出设置页面会抛出异常信息,
// 这样在文件上传的地方就需要进行异常信息的处理了;
factory
.
setMaxFileSize
(
"256KB"
);
// KB,MB
/// 设置总上传数据总大小
factory
.
setMaxRequestSize
(
"512KB"
);
// Sets the directory location where files will be stored.
// factory.setLocation("路径地址");
return
factory
.
createMultipartConfig
();
}
}
package
com
.
reyun
.
dmp
.
configuration
;
import
javax.servlet.MultipartConfigElement
;
import
org.springframework.boot.web.servlet.MultipartConfigFactory
;
import
org.springframework.context.annotation.Bean
;
/** * 文件上传配置 * * @author wangjf * @date 2018年03月21日15:15:20 */
public
class
FileUploadConfiguration
{
@Bean
public
MultipartConfigElement
multipartConfigElement
()
{
MultipartConfigFactory
factory
=
new
MultipartConfigFactory
();
// 设置文件大小限制 ,超出设置页面会抛出异常信息, // 这样在文件上传的地方就需要进行异常信息的处理了; factory.setMaxFileSize("256KB"); // KB,MB /// 设置总上传数据总大小 factory.setMaxRequestSize("512KB"); // Sets the directory location where files will be stored. // factory.setLocation("路径地址"); return factory.createMultipartConfig(); } }
\ No newline at end of file
...
...
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