I created an API recently that allows video and audio files to be uploaded and it was working fine until one customer uploaded a large video and I got this error:
Failed to read the request form. Multipart body length limit 134217728 exceeded.
From many posts it's evident that the philosophy behind request size limitation is to reduce the chances of DDoS attack. (Please correct me if I'm wrong).
- What security holes do I open up if I do not limit the max request length for file upload to my webserver?
- https://manage.accuwebhosting.com/knowledgebase/2997/ASPNet-Error--Maximum-request-length-exceeded.html
However, I uploaded a large video myself, and watched the bandwidth both on my local PC and on the server. I have a VPS for this app and I can watch bandwidth using Task Manager's Performance tab, by selecting Ethernet and seeing the graph of send and receive.
The point is, I saw that a high traffic going on for some minutes when I was uploading the file, and then I saw that error. This means that the resources of the server are being consumed even when there ASP.NET Core rejects the request.
So, I don't understand this part. How ASP.NET Core diminishes the chance of DoS, or DDoS attacks by limiting request size, while bandwidth is taken in reality? A logical way would to drop the request from the beginning for multipart/form-data
content types if the request payload/body was too huge and even do not consume the bandwidth.