Uploading large files

  • Thread starter Thread starter Phong Pham
  • Start date Start date
P

Phong Pham

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
 
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.
 
Back
Top