Uploading large files

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
 
S

Steve C. Orr, MCSD

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top