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."

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]

Reply via email to