locked
File upload limit question RRS feed

  • Question

  • User1526116210 posted

    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?

    Sunday, August 11, 2013 10:17 PM

Answers

  • User-821857111 posted

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 12, 2013 5:56 AM
  • User895691971 posted

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 12, 2013 6:21 AM

All replies

  • User-1716253493 posted

    Try like this

    long totallength = FileUpload1.FileContent.Length+FileUpload2.FileContent.Length+FileUpload3.FileContent.Length;
    
    if (totallength > 15000000)
    {
    
    }



    Sunday, August 11, 2013 10:32 PM
  • User-821857111 posted

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 12, 2013 5:56 AM
  • User895691971 posted

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 12, 2013 6:21 AM
  • User1526116210 posted

    Ok, thank you. I couldn't test for myself because I am away from my computer.

    Monday, August 12, 2013 6:49 AM
  • User-821857111 posted

    The whole request is counted, even the Page size.

    Huh? What page?

    Monday, August 12, 2013 7:14 AM
  • User895691971 posted

    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?

    Monday, August 12, 2013 7:28 AM
  • User-821857111 posted

    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).

    Monday, August 12, 2013 7:44 AM
  • User895691971 posted

    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?

    Monday, August 12, 2013 9:07 AM
  • User-821857111 posted

    An HTTP Request consists of headers, form data, cookies, querystrings and client certificates.

    Monday, August 12, 2013 3:46 PM
  • User895691971 posted

    Can I get a link for full information about Http Requests?

    Monday, August 12, 2013 5:27 PM
  • User-821857111 posted

    Here's the documentation: http://msdn.microsoft.com/en-us/library/system.web.httprequest.aspx

    Tuesday, August 13, 2013 4:29 AM