I've specified a maxRequestLength
in my web.config (MVC) like so:
<location path="File/Upload">
<system.web>
<httpRuntime maxRequestLength="330"/>
</system.web>
</location>
When having a look in the network tab while testing for file uploads that exceed 330kb, I can see the response from the server is 500
and the details are The required anti-forgery form field "__RequestVerificationToken" is not present.
Why is this the case? Is the framework not capable of providing details of maxRequestLength
in the response? Or is it that it merely doesn't want to in order to not give away info about the system?
Or is it that my request has been truncated/cropped in order to cater for the limit, which has inadvertently trimmed off the request verification token?
NOTE
This works fine with files that do not exceed 330kb, and my upload works.
I see you set maxRequestLength is 330, this is the limit for file upload. this value follow the rule below:
1 Mb = 1024kb
as you can see more detail at:
https://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxrequestlength(v=vs.110).aspx
So when you set maxRequestLength="330", the system will be understand that the file upload is limit 330kb.