Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit size in upload? 1

Status
Not open for further replies.

netangel

Programmer
Feb 7, 2002
124
PT
I'm not sure is this is a ASP.NET question or HTML.

When I use a 'input type=file' to upload a file, is it suposed to have a limit on the file size? I can't find a single place where that's written, but all files with more than 2.5Mb don't upload.
The form doen't even post correctly.

If I upload a file with a 2.3Mb lenght, it takes about half a minute before it reaches the load method of the webform. During that time the progress bar is increasing slowly. After that, the file is saved sucessfully.
If the file has more than 2.5Mb, the progress bar jumps in less than 1 second and the load event isn't reached. No error appears on the screen. It just stops.

Is there a limit on the upload size? Am I doing anything wrong? Is this a problem with ASP.NET or just a HTML one?

NetAngel
 
hey net,

couple questions:
1. Are you sure that some admin hasn't put a cap on file sizes for the file areas you're trying to up load?

2. Is this new code you wrote, or working on someone else's? only reason i ask is that we found that there was no default upload max set unless we actually put in in our codebehind. so maybe there's something set in the code thats already limiting it

The reason its taking so long for the file to upload is because of hte way the upload control works:

It uploads the entire file first, then does the postback.

i.e. in our code, a file would be uploaded. Once done, a function in our code behind checks the size, and if its too big its never saved to the server (although the whole file still got uploaded).

Since your larger 2.5MB file seems to not even perform the upload, is it possible someone has javascript on the page already that maybe checks the size and decides whether it can be uploaded or not?

Just some thoughts anyway
:)

D
 
I think I was mistaken about the limit size. It accepts files with more than 3Mb, but still refuses bigger than 6Mb.

About your suggestions, jfrost:
I have no limitation. I'm working on a local computer, and no admin caped my file sizes.
This is my code. I have a way to limit size (on the web config) but it is set to unlimited. Besides, it never reaches the server code, so it can't be that limit.
I have no Javascript code in that page.

It takes a big amount of time to upload a 3Mb file, but after that it works. To upload a 6Mb file the progress bar on the bottom flys to the end in less than a second. It doesn't even do that upload (the one before the postback).

If you have any other suggestion, please HELP ME.
NetAngel
 
Thanks a lot it worked like a charm.

For those who might have a similiar problem, .NET has a default limit of 4Mb on the size of the posted page, to avoid massive server atacks.
To solve the problem, I just added the
Code:
'<httpRuntime maxRequestLength=&quot;100000&quot; />'
tag on my web config.

Here goes your star.
NetAngel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top