• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

FileUploadException

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I ma getting this error when uploading a file
apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly(at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java).

ANy idea?? Any help is gretaly appreciate. My google search is exhausted!!!
Thanks
Rajani
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any code snippet??

I would like to refer you to this. Its better to just upload a file in a simpler manner then go for something complex.

TIP: try to upload any small file first
[ October 12, 2004: Message edited by: adeel ansari ]
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post the stackTrace of the exception.

Are you trying to upload a a file whose size is larger than the value specified in the code ( usually ppl keep it around 10 MB)?
 
Mini Pilla
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using jakarata common upload functions. I am able to upload file when I am doing from browser. In my application, .net client is trying to upload to Jboss. .net client is webclient.

Error : org.apache.commons.fileupload.FileUploadException: Processing of
multipart/form-data request failed. Stream ended unexpectedly.

I even tried to echo the request....and this is what i got..
Here is the request line and request headers sent by your browser:
POST / HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Referer: http://localhost:8080/examples/jsp/BrowsePage.jsp
Accept-Language: en-us
Content-Type: multipart/form-data; boundary=---------------------------7d41112770e48
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)
Host: localhost:8088
Content-Length: 643
Connection: Keep-Alive
Cache-Control: no-cache

-----------------------------7d41112770e48
Content-Disposition: form-data; name="xpdl"; filename="C:\boot.ini"
Content-Type: application/octet-stream



In my opinion,its is somethign to do with boundary......I did everyhitng....i increased the threashold size in my servlet but of no use

Thanks for the help....
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I've been trying since this morning to use the "jakarta apache" upload file.

I could very easely upload file on my server, change the file name and path, however, I really don't understant how to directly write the file on the disk, the basic example http://jakarta.apache.org/commons/fileupload/using.html shows how to upload using the file kept in memory.

but

now it's 3 hours that I'm trying to understand how to setup the max memory size and use the alternative way to write the file directly on the disk, of course, it was easy to set the size :
upload.setSizeThreshold(maxMemorySize);

but all I get is a servlet exeption telling me that the file is too large.
of course I know that, but how can I do something about is ?

i mean
if (item.isInMemory() ){ // the file size is under my "maxMemorySize"
// do the regular file upload from memory
// easy, I just followed the example in jakarta website
}
else {

// my file is too large, I cannot overload the server, need to write on the temp folder ( defined with setRepositoryPath("/tmp/");
// how can I do that ??
// I can understand some javaDoc, but I'm not an engeneer, really need some sample code to see how it's working

}

If anyone could give me a link to a more precise sample page than on the jakarta help files...

really frustrating to only have


// Process a file upload
if (writeToFile) {
File uploadedFile = new File(...);
item.write(uploadedFile);
}
// that is so easy !!

else {
InputStream uploadedStream = item.getInputStream();
...
uploadedStream.close();
}


what to do instead of the " ... " ???


thanks for your support (and please forgive my frenchie english)
 
Willie Smits can speak 40 languages. This tiny ad can speak only one:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic