Uploading large files

Discussion in 'ASP .Net' started by Phong Pham, Jul 1, 2003.

  1. Phong Pham

    Phong Pham Guest

    I'm creating a web page to upload files, but I'm having a problem uploading
    files larger than about 3.5 mb. Anything smaller than 3.5 mb is ok. If the
    file is larger, it doesn't generate an error, it just doesn't do anything.
    Can anyone show me how to fix that problem?

    I'm also trying to trap any files larger than 3.5 mb to let the user know
    that they can't upload files larger than that:

    If MyUpload.PostedFile.ContentLength > 3500000 then
    lblMessage.Text = "File size cannot exceed 3.5 mb limit"
    End If

    But if the file is 4 mb or bigger, that code doesnt' catch it. Any ideas?

    Thanks first
    Phong
     
    Phong Pham, Jul 1, 2003
    #1
    1. Advertisements

  2. You need to add or modify the following section in your web.config file:

    <configuration>
    <system.web>
    <httpRuntime maxRequestLength="4096" />
    </system.web>
    </configuration>

    The above value (4096 KB) is the default maximum upload file size.

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net


    "Phong Pham" <> wrote in message
    news:e$...
    > I'm creating a web page to upload files, but I'm having a problem

    uploading
    > files larger than about 3.5 mb. Anything smaller than 3.5 mb is ok. If the
    > file is larger, it doesn't generate an error, it just doesn't do anything.
    > Can anyone show me how to fix that problem?
    >
    > I'm also trying to trap any files larger than 3.5 mb to let the user know
    > that they can't upload files larger than that:
    >
    > If MyUpload.PostedFile.ContentLength > 3500000 then
    > lblMessage.Text = "File size cannot exceed 3.5 mb limit"
    > End If
    >
    > But if the file is 4 mb or bigger, that code doesnt' catch it. Any ideas?
    >
    > Thanks first
    > Phong
    >
    >
    >
     
    Steve C. Orr, MCSD, Jul 1, 2003
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Munes
    Replies:
    0
    Views:
    2,213
    Munes
    Jan 31, 2006
  2. =?Utf-8?B?U3RldmVuIEJlcmtvdml0eg==?=

    Timeout uploading large files

    =?Utf-8?B?U3RldmVuIEJlcmtvdml0eg==?=, Feb 10, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    552
    Steven Cheng[MSFT]
    Feb 13, 2006
  3. Replies:
    1
    Views:
    481
    Alexey Smirnov
    Feb 20, 2007
  4. Lad

    Large files uploading

    Lad, Dec 12, 2006, in forum: Python
    Replies:
    7
    Views:
    479
    Fredrik Lundh
    Dec 15, 2006
  5. Wolfgang Draxinger

    HTTP POST uploading large files

    Wolfgang Draxinger, Jan 19, 2008, in forum: Python
    Replies:
    4
    Views:
    1,171
    Wolfgang Draxinger
    Jan 20, 2008
  6. Uday Bhaskar

    Problem uploading large files in .net

    Uday Bhaskar, Feb 24, 2004, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    265
    Ken Cox [Microsoft MVP]
    Feb 28, 2004
  7. Dan

    Uploading Large Files

    Dan, Jul 7, 2008, in forum: ASP General
    Replies:
    6
    Views:
    383
    Dave Anderson
    Jul 9, 2008
  8. Dan

    Uploading Large Files

    Dan, Jul 15, 2008, in forum: ASP General
    Replies:
    0
    Views:
    166
Loading...