How to set the max size of upload file

前端 未结 16 675
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 12:13

I\'m developing application based on Spring Boot and AngularJS using JHipster. My question is how to set max size of uploading files?

If I\'m trying

16条回答
  •  Happy的楠姐
    2020-12-04 12:30

    You need to set the multipart.maxFileSize and multipart.maxRequestSize parameters to higher values than the default. This can be done in your spring boot configuration yml files. For example, adding the following to application.yml will allow users to upload 10Mb files:

    multipart:
        maxFileSize: 10Mb
        maxRequestSize: 10Mb
    

    If the user needs to be able to upload multiple files in a single request and they may total more than 10Mb, then you will need to configure multipart.maxRequestSize to a higher value:

    multipart:
        maxFileSize: 10Mb
        maxRequestSize: 100Mb
    

    Source: https://spring.io/guides/gs/uploading-files/

提交回复
热议问题