Jsp – java.io.IOException: Corrupt form data: premature ending


Am having a problem with my Jsp application while usind Oreilly's multipart classes.

The problem is that my app is running very well when I run it on some machines, but when I try running it on some servers for some reasons I dont understand, It throws this error : java.io.IOException: Corrupt form data: premature ending
at com.oreilly.servlet.multipart.MultipartParser.(MultipartParser.java:205)
at com.oreilly.servlet.multipart.MultipartParser.(MultipartParser.java:119)
The above is just part of the logs am getting.

Someone tell me:- why is it that the app runs very well on some servers, while it gives me a problem when I try to run it from a different one?

What could be possible solutions to my problem?

Am running glassfish server3 on all servers.

Best Solution

The ancient Oreilly multipart parser has some bugs. See also this related question for an overview Corrupt form data: premature ending (Resolved). Rather use Apache Commons FileUpload or just the new Servlet 3.0 builtin request.getPart() method. See also How to upload files to server using JSP/Servlet?

Related Question