0

I have a react app which is using axios to upload file to server. Below is the code

const save = yield call(axios.put, url, searchCriteria.payload, {
       params: params,
     });

The issue is that, this code works fine as long as the payload size is less than 10mb. If the payload is lager than 10mb the request payload goes as empty. I have tried setting the content length as below

maxContentLength: 10000000,
maxBodyLength: 10000000

I have tried setting the length and timeout in web config file on iis but nothing seems to work for payload larger than 10mb.

  • Does this answer your question? [How to increase the max upload file size in ASP.NET?](https://stackoverflow.com/questions/288612/how-to-increase-the-max-upload-file-size-in-asp-net) [This](https://www.webdavsystem.com/server/documentation/large_files_iis_asp_net/#nav_maxuploadfilesizeiniisandaspnetnetframework) is probably a better reference. – HMR Mar 24 '21 at 08:52
  • I have tried this but it does not work. I am able to increase the file size to greater than 10mb and upload using Swagger and postman. But when i try to upload from my react app, the axios doesnot attach the payload to the api call. – Anurag Tyagi Mar 24 '21 at 09:25

2 Answers2

1

in my opinion the problem is server side. what languages do you use for your backend api? Bye Marco.

Bonci Marco
  • 301
  • 2
  • 5
  • 17
0

Check if the maximum allowed content length in iis:

Click on the site you deployed in IIS->Find the RequestFiltering component->Edit Request Filtering Settings enter image description here

Theobald Du
  • 824
  • 4
  • 7