struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Himanshu Vasishth <hvasis...@gmail.com>
Subject How to gracefully handle a closed request stream caused by struts.multipart.maxSize on client
Date Thu, 15 Oct 2009 21:56:24 GMT
I am using struts.multipart.maxSize property to limit the size of
files that can be uploaded by the client application. We have our
custom client which uploads files to server.

The client is written in C# (though it shouldn't matter) When the
client tries to upload a file which is say twice the size limit, the
request stream is abruptly closed by the server while the client is
trying to write data onto the stream. This an IOException instead of a
WebException with status code 413. As a result an unfriendly error
message gets displayed to users.

I am assuming the the closing of stream is by design to prevent a
large file from getting created in the temp folder on server. However,
is there a way to gracefully handle this scenario on client so that we
can detect the stream was closed due to a 413?

Thanks
Himanshu

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message