Last post Aug 13, 2013 04:29 AM by Mikesdotnetting
Aug 11, 2013 10:17 PM|mhcodner|LINK
I know I can change the upload limit using my web.config fle but I'm just wondering is that the upload limit per file or the request as a whole?
Right now, I have my upload limit at 15MB but from the same page I can upload multiple files. If I upload mulitple files that as one are less than 15MB but as a whole more than 15MB would that generate a file request length exceeded exception?
Aug 11, 2013 10:32 PM|oned_gk|LINK
Try like this
long totallength = FileUpload1.FileContent.Length+FileUpload2.FileContent.Length+FileUpload3.FileContent.Length;
if (totallength > 15000000)
Aug 12, 2013 05:56 AM|Mikesdotnetting|LINK
I'm just wondering is that the upload limit per file or the request as a whole?
The limit is imposed on the Request, not individual parts of it.
If I upload mulitple files that as one are less than 15MB but as a whole more than 15MB would that generate a file request length exceeded exception?
Yes, it would generate the HttpException. You can test this for yourself easily enough.
Aug 12, 2013 06:21 AM|Afzaal.Ahmad.Zeeshan|LINK
The whole request is counted, even the Page size. But thats just a few Kilo Bytes, so its not kept in mind! The File size takes most of the request size.
I am sure it will create an execption. As the request as a whole will take the total size of the Request. So if altogether they exceed in size of 15MB. Thats gonna give an excetion.
Aug 12, 2013 06:49 AM|mhcodner|LINK
Ok, thank you. I couldn't test for myself because I am away from my computer.
Aug 12, 2013 07:14 AM|Mikesdotnetting|LINK
The whole request is counted, even the Page size.
Huh? What page?
Aug 12, 2013 07:28 AM|Afzaal.Ahmad.Zeeshan|LINK
I am sure if you load a page of 1KB for 1024 times. I will use 1MB Bandwidth. So in this case it does mean that the page also uses some of the size!
Isn't it this way?
Aug 12, 2013 07:44 AM|Mikesdotnetting|LINK
There is no "page" in a request. There are headers an possibly a payload (in the case of a POST request). The response contains the "page" (if it is of type text/html).
Aug 12, 2013 09:07 AM|Afzaal.Ahmad.Zeeshan|LINK
So, the page is only a load on Bandwidth, but not on Http Requests. In this case, the Request will only have the data from the form! Right?
Aug 12, 2013 03:46 PM|Mikesdotnetting|LINK
An HTTP Request consists of headers, form data, cookies, querystrings and client certificates.
Aug 12, 2013 05:27 PM|Afzaal.Ahmad.Zeeshan|LINK
Can I get a link for full information about Http Requests?
Aug 13, 2013 04:29 AM|Mikesdotnetting|LINK
Here's the documentation: http://msdn.microsoft.com/en-us/library/system.web.httprequest.aspx