1. 程式人生 > >spring boot 檔案上傳配置檔案

spring boot 檔案上傳配置檔案

spring:
  thymeleaf.cache : false
  messages.basename : static/message/messages
  http:
     multipart:
        enabled: true
        file-size-threshold: 0
        max-file-size: 250Mb
        max-request-size: 500Mb
        location: /home/upload_tmp #測試有問題

 

 

/**
 * 檔案上傳臨時路徑
 */
 @Bean
 MultipartConfigElement multipartConfigElement() {
    MultipartConfigFactory factory = new MultipartConfigFactory();
    factory.setLocation("/app/pttms/tmp");
    return factory.createMultipartConfig();
}