commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prajakta nivargi <pniva...@gmail.com>
Subject MalformedStreamException during fileupload
Date Tue, 04 Oct 2005 03:41:21 GMT
Hello,

I am trying to upload a file on a form webpage. I am using the
JakartaMultipartRequest. My application runs on a web server and symphony
WebWork.
My webwork fileupload interceptor looks like this:

<interceptor name="fileUpload" class="
com.opensymphony.webwork.interceptor.FileUploadInterceptor">
<param name="allowedTypes">text/plain</param>
<param name="maximumSize">8192</param>
</interceptor>

I have tried with many different MIME filetypes. The problem area is the
class MultipartStream.java. The skipPreamble() method calls the
discardBodyData() method in turn. In the discard.. method the else part of
the following code snippet gets called:

if (bytesRead != -1)
{
tail = pad + bytesRead;
}
else
{
// The last pad amount is left in the buffer.
// Boundary can't be in there so signal an error
// condition.
total += pad;
throw new MalformedStreamException(
"Stream ended unexpectedly");
}

And that's where the problem is.

Could anybody tell me why I'm getting the MalformedStreamException no matter
which file I upload.

Thanks,
Prajakta

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message