You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Himanshu Vasishth <hv...@gmail.com> on 2009/10/15 23:56:24 UTC

How to gracefully handle a closed request stream caused by struts.multipart.maxSize on client

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