0

I have a simple page with ajax uploader component. When I add file, controller method is called that saves file.

security/requestFiltering/requestLimits, maxAllowedContentLength and httpRuntime.maxRequestLength values are set

Expected result: request is cancelled immediately if upload of big file is started with any error response.

Actual behaviour: file upload request is (slowly) finished, error response is returned.

Is there any simple way (without writing my own HTTP request handling component) to stop and cancel request before its big body was sent?

(idea is to avoid unnecessary load on both browser and server that work on request that will be failed anyway)

thmshd
  • 5,729
  • 3
  • 39
  • 67
user1782982
  • 75
  • 2
  • 9
  • Does https://stackoverflow.com/questions/28604874/how-to-prevent-files-to-upload-if-exceed-specific-size-limit help? – thmshd Dec 07 '17 at 20:21
  • Both client-side restriction on control and server-side web.cofig keys were applied. But problem appeared as part of penetration testing, so JS can be easily circumvented and even with web.config changes request still waits to upload whole file only to be denied. Theoretically, there should be a way to cancel request based on its header Content-length, without reading whole stream imposing potentially heavy load onto server. – user1782982 Dec 08 '17 at 13:07

0 Answers0