0
votes

I am uploading files on azure storage file share. I followed this guide: https://docs.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.

1
Try set maxRequestLength and maxAllowedContentLength values in your web.config file. You could follow this doc.cnblogs.com/malaikuangren/archive/2012/09/23/2698974.htmlGeorge Chen

1 Answers

1
votes

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