The code is same. In the html side i am setting 
the  

   top.Body.document.calform.encoding = "multipart/form-data";
      top.Body.document.calform.url.value = "save";
      top.Body.document.calform.submit();

and the form parameters are

  <form name=calform method="POST" Action="<%=
response.encodeRedirectURL("/TopicSupportPresentation?as_presentation=toSave
OrAddTopicDataMaintenance") %>" > 

and Are you saying there is a setting in websphere or webserver to use
multipart handler?

If yes, can you tell me the setting parameter, so i can check on it.


Thanks
Chad

-----Original Message-----
From: Martin Cooper [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 01:20 AM
To: Jakarta Commons Users List
Subject: Re: Websphere and fileupload problem -- Error"Stream ended
unexpected ly


On Tue, 27 Jan 2004, Parchuri, Chad wrote:

> I tried file upload in my local environment NT IE Browser 5.5, Websphere
> Studio, which works fine. when I migrarted the code to SUN SOLARIS
websphere
> 4.0 box, IE 5.5. i am getting the following error.
>
> "Stream ended unexpectedly."

This most commonly happens when some other code has already consumed the
request input stream. I'm not too familiar with Websphere, but is it
possible that one version includes a multipart handler by default, while
it is disabled by default in the other? (Or that your code is in not quite
the same web app environment in the two different containers?)

--
Martin Cooper


>
> i could only upupload a file size of 6K
>
> Any help will be highly appreciated. thanks
>
> Here is the snippet of code, i am using.
>
>
>                       boolean isMultipart =
> FileUpload.isMultipartContent(req);
>
>                       // if not, send to message page with the error
> message
>                       if(!isMultipart){
>                               throw new OSNException("Request was
> notmultipart, and cannot be uploaded. ", 3, "NO", "N/A");
>                       }
>                       // now lets create a handler for the upload request.
>                       DiskFileUpload upload = new DiskFileUpload();
>
>                       upload.setSizeMax(1000000);
>               // maximum size that will be stored in memory
>               upload.setSizeThreshold(1024000);
>               // the location for saving data that is larger than
> getSizeThreshold()
>               upload.setRepositoryPath("/tmp");
>
>                       // parse this request by the handler
>                       // this gives us a list of items from the request
>                       List items = upload.parseRequest(req);
>
>                       // now iterate over this list
>                       Iterator itr = items.iterator();
>               long formDatalength = 0;
>                       while(itr.hasNext())
>                       {
>                               FileItem item = (FileItem) itr.next();
>
>                               if
>
> (!item.getFieldName().equalsIgnoreCase("myimage"))
>                               {
>                                       .....
>                               }
>                               else
>                               {
>                                       byte[] dataByte = item.get();
>
>                                       TopicImageImpl topicImageImpl =
> newTopicImageImpl();
>
>
> topicImageImpl.setTopicImage(dataByte);
>                               }
>
>
>
>
>
>
>
> **************************************************************************
> This e-mail and any files transmitted with it may contain privileged or
> confidential information. It is solely for use by the individual for whom
> it is intended, even if addressed incorrectly. If you received this e-mail
> in error, please notify the sender; do not disclose, copy, distribute, or
> take any action in reliance on the contents of this information; and
delete
> it from your system. Any other use of this e-mail is prohibited. Thank you
> for your compliance.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



************************************************************************** 
This e-mail and any files transmitted with it may contain privileged or 
confidential information. It is solely for use by the individual for whom 
it is intended, even if addressed incorrectly. If you received this e-mail 
in error, please notify the sender; do not disclose, copy, distribute, or 
take any action in reliance on the contents of this information; and delete 
it from your system. Any other use of this e-mail is prohibited. Thank you 
for your compliance.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to