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

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

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

    Re: Uploading large files

    PJ, Jun 24, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,086
  2. Munes
    Replies:
    0
    Views:
    2,047
    Munes
    Jan 31, 2006
  3. =?Utf-8?B?U3RldmVuIEJlcmtvdml0eg==?=

    Timeout uploading large files

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

    Large files uploading

    Lad, Dec 12, 2006, in forum: Python
    Replies:
    7
    Views:
    281
    Fredrik Lundh
    Dec 15, 2006
Loading...

Share This Page