Help with HTML control

  • Thread starter Thread starter Bob B
  • Start date Start date
B

Bob B

I'm new to this so I hope I am able to explain my problem.

I have a page with a HTML browse/input button. I browse for a file and
click a button to move a file from my local computer to a server. The
page_init code fires just fine if the file selected for copy is 3 MB
or less. Anything greater causes a Page Not Found error before the
page_init fires. Does anyone know why the file size is an issue?
There is plenty of disk space on the server. I can manually copy the
file without a problem.

Thanks in advance,
Bob
 
Hey Bob,
I have had the same issue. You have to specify in the web.config file what
the max file size would be. If you specify it in the code what the file size
limit is it will get over written by the default value. To get around that
you have to put this tag in the web.config file. Anywhere should be good, as
long as it is within the <system.web> tags.
<httpRuntime
maxRequestLength="2934883" 'I believe this is in bytes
executionTimeout="3600" 'in seconds, if the files are going
to be big I would suggest to put a huge value for timeout.
This should work. Let me know if it doesn't. I will look it up for you.

--Landi
 
Hey Bob,
I had the same problem too. Even if you specify in the code what the size
limit would be, .NET over writes it with a default value. To get around this
you have to put this tag in the web.config file.

<httpRuntime
maxRequestLength="987784" 'I think this is in bytes.
executionTimeout="3600" 'seconds. If you are allowing big files
to be uploaded then I would suggest to make this time out big.
/>

Make sure this tag is within the <system.web> tab.
Please let me know if this doesn't work. I can look it up for you.

--Landi
 
Landi,
Thanks. You saved me a ton of time. I searched all day looking for an
answer without sucess.

Thanks again,
Bob
 
Back
Top