Search code examples
javaspring-bootazure-storageazure-storage-files

How to upload a large file on azure storage file share?


I am uploading files on azure storage file share. I followed this guide: https://learn.microsoft.com/en-us/azure/storage/files/storage-java-how-to-use-file-storage It works fine, but I can not upload files larger than 2MB. What is the problem?

Spring does not show any error and on the frontend I get 500 Internal Server Error.


Solution

  • I found the answer. It is not an azure problem. I was converting multipart files to files before uploading. In Spring boot the default max size for multipart is 1MB so it has to be changed in application.yml. This should solve the problem:

    servlet:
        multipart:
          max-file-size: -1
          max-request-size: -1