commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Parchuri, Chad" <cparch...@ets.org>
Subject Websphere and fileupload problem -- Error"Stream ended unexpected ly
Date Tue, 27 Jan 2004 21:48:59 GMT
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: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message