Upload huge file size: "The page cannot be displayed" browser error

J

Joe

I have an upload file operation in the web application. UploadForm.asp is
the form,
and UploadAction.asp is the form processing.

//UploadForm.asp
<FORM NAME="InputForm" ACTION="UploadAction.asp" METHOD="POST"
enctype=multipart/form-data>
<input type="file" name="fileName">
//etc ...
</FORM>

After I deploy the application to the web server, if I upload a small file
size, it is fine.
But if I upload a huge file size more than 10MB, then it cannot even go to
UploadAction.asp.
After 30 seconds, it has error "The page cannot be displayed" shown on the
web browser.
It cannot even go to UploadAction.asp. But both UploadForm.asp and
UnploadAction.asp are
in the same machine.

Interestingly, if I test in local machine, I can upload any file size
without problem.

I don't have any hints now. any ideas?
please advise. thanks!!
 
J

Jason Brown [MSFT]

One question, is there a proxy server between the client and server in the
failing scenario?


--
Jason Brown
Microsoft GTSC, IIS

This posting is provided "AS IS" with no warranties, and confers no
rights.
 
L

Lau Lei Cheong

Try set a higher timeout value in machine.config.

The error occurs because your browser is still sending the file out. Of
course the browser cannot receive response from server at the same time and
therefore determines the web server is not responding. Common problem on
uploading files.

Also note that if you try to upload file with filesize larger than the
maximum request length, the same error may result or you'll get
"System.Web.HttpException: Maximum request length exceeded."
 
J

Joe

The error occurs because your browser is still sending the file out. Of
course the browser cannot receive response from server at the same time and
therefore determines the web server is not responding. Common problem on
uploading files.

Thanks Lau Lei Cheong!! To solve the problem, I try to understand the
underlying principles first. The error "The page cannot be displayed" is the
error from web browser because web browser failed to connect to the server
for that requested page. correct? When UploadForm.asp post data to
UploadAction.asp, the web browser append the huge file in HTTP header first,
and at the same time, the web browser try to connect to UploadAction.jsp, is
that what you mean?

please advise more. thanks!!
 
J

Joe

one more, "The page cannot be displayed" means client-side web browser time
out, or web server time out? This is very important.

please advise. thanks!!
 
L

Lau Lei Cheong

Joe said:
Thanks Lau Lei Cheong!! To solve the problem, I try to understand the
underlying principles first. The error "The page cannot be displayed" is the
error from web browser because web browser failed to connect to the server
for that requested page. correct?
Yes. Exactly.
When UploadForm.asp post data to
UploadAction.asp, the web browser append the huge file in HTTP header first,
and at the same time, the web browser try to connect to UploadAction.jsp, is
that what you mean?
Not exactly.

When uploading files with <form encType="multipart/form-data">, the files
are embedded in the request stream. And your page can'r return anything
unless 1) having the stream fully receieved or 2) you process the stream
yourself or 3) you use any of the third party conponent to process it.
 
L

Lau Lei Cheong

In fact you can Response.Write() something to push the response header of
current page to the client first and put it in wait state. However, using
this trick you'll no longer be able to use Response.Redirect() or
Server.Transfer() to move to another page. You'll have to insert client-side
script like "window.location='abc.asp';" instead.
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top