File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

file upload problem..urgent please

 
Sripathi Krishnamurthy
Ranch Hand
Posts: 232
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to upload a 25 MB file from the browser(IE 6). The app server is Websphere (4.0.6) and HTTP Server is IBM Http Server (1.3.19).
I use com.oreilly.servlet.multipart.MultipartParser for uploading.

Example,

MultipartParser parser = null;
String redirect = null;
Bean sb = null;
try {
parser = new MultipartParser(req, 26214400);
// max size of image is 25MB
Part part;
FilePart filePart = null;
while ((part = parser.readNextPart()) != null)
{
String paramName = part.getName();
if (part.isFile()) {
filePart = (FilePart) part;
InputStream is = filePart.getInputStream();
ObjectInputStream o = new ObjectInputStream(is);
sb = (Bean) o.readObject();
o.close();
// add the bean object to the DB:

I setup a server from WSAD(Websphere Application development on WIN XP) and upload the file of 25mb, the upload is fine without any errors. It works perfectly.
BUT, but any image over 10 MB of size doesnt upload (in Websphere running on AIX 5) and throws an error.
I am trying on this issue since 4 days now without any benefit.

The error thrown is,
java.io.IOException: Corrupt form data: premature ending
at com.oreilly.servlet.multipart.MultipartParser.<init>(MultipartParser.java:166)
at com.oreilly.servlet.multipart.MultipartParser.<init>(MultipartParser.java:94)
at mypackage.servlets.dev.Saver.doPost(Saver.java:52)

and sometimes

java.io.IOException: unexpected end of part
at com.oreilly.servlet.multipart.PartInputStream.fill(PartInputStream.java(Compiled Code))
at com.oreilly.servlet.multipart.PartInputStream.read(PartInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readFullyInternal(ObjectInputStream.java(Inlined Compiled Code))
at java.io.ObjectInputStream.bufferData(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readInt(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.inputArray(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))

1) why does the upload happen fine when run in local WSAD environment and not in live environment?
2) Are there known issues in Websphere 4.0.6 and IBM HTTP Szerver 1.3.19?
3) What are the other options available for uploading larger file size other than using com.oreilly.servlet.multipart.MultipartParser?

please give me your very valuable feedback

Thanks in advance
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

1) why does the upload happen fine when run in local WSAD environment and not in live environment?
2) Are there known issues in Websphere 4.0.6 and IBM HTTP Szerver 1.3.19?
3) What are the other options available for uploading larger file size other than using com.oreilly.servlet.multipart.MultipartParser?

Just a guess, but since you say the upload is fine when everything is running locally, could it not be a network problem? You could try some sort of network monitoring tool to watch what is actually happening.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And maybe sitting back and not being so rushed that you think your problem needs the urgent attention of the entire world might bring new perspectives as well (plus some time to read the naming policy of this site).
 
Sripathi Krishnamurthy
Ranch Hand
Posts: 232
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul,
It cant be a network issue since I am able to upload 10mb file from the web. Anything greater than 10mb doesnt work. Also it immediately errs out when upload button is hit. So I think this is not a network issue.
I looked at the httpd.conf and nothing is set there to stop posting more than 10mb content.

Jeroen,
yes, I am still looking at lot of other possibilities. But not able to pinpoint the exact reason for this is what concerns me.

If anyone has any info on this, that will be greatly helpful.

Thanks
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

It cant be a network issue since I am able to upload 10mb file from the web. Anything greater than 10mb doesnt work. Also it immediately errs out when upload button is hit. So I think this is not a network issue.
I looked at the httpd.conf and nothing is set there to stop posting more than 10mb content

Hmm. That doesn't completely exclude network issues and I wouldn't rule it out so quickly. For the time it would take, it is always worth a look. Still, as I said its just a guess.
 
James Carman
Ranch Hand
Posts: 580
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To answer your third question, you can look at the Jakarta Commons FileUpload project.
 
Deepak sankhla
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sripathi,
i m also using the same com.oreilly.servlet.multipart.MultipartParser for uploading image files, but in my case, i m not even able to upload files whose size>30k.
Did you get any luck with this problem? if yes then pls let me know...

thanks a bunch
 
Premil Jacob
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a suggestion, the GET method of sending values to the server has a size limit.
 
Sripathi Krishnamurthy
Ranch Hand
Posts: 232
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I still havent found any solution for this problem. In your case, I may help you out.
1) Check the httpd.conf and see if any setting has limited the content length. If yes, increase the limit.
2) check whether you are able to upload using different browser.that is if you are using IE, try with netscape or mozilla. If it works with another browser, contact Bill gates.
3) check whether the network is fine and supports heavy uploads. If not contact your system administrator.
4) check whether there is any problem in the form itself.
5) check whether the servlet is fine and works for smaller uploads. If uploads are fine for smaller uploads, the code cant be blamed.
6) Finally check the Webserver you are using and check the bug list and see if this is a known problem. I have checked this and most of the webservers have problem with larger uploads. some have fixed them though.

If all of the above dont work, then we are sailing in the same boat.
 
Bhiku Mhatre
Ranch Hand
Posts: 127
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out if this helps.
http://www.coderanch.com/t/71730/Websphere/Upload-File-Doesn-work-Wepsphere

Regards,
Milind
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic