How would I go about doing this? I used the request.getInputStream() function - However, it gives me more than what I wanted.
This is what I get:
I am just interested in the *** xml content ***
So, I guess I need to parse the InputStream to get the xml? Is that how everyone else does file upload processing?
I've read somewhere that Apache Commons FileUpload has lots of utilities that can make upload processing easier. But before I go to my manager to get his approval to use a 3rd party library (Apache), I would like to know if what I want to achieve can be done using servlet APIs alone.
You would, pretty much, end up doing what the writers of the 3rd party libraries have already done (including learning some things the hard way).
[ November 18, 2007: Message edited by: Ben Souther ]
The Servlet and JSP specs do not make any special provisions for multipart requests (file uploads).
Servlet and JSP developers either have to depend on third party libraries or make their own framework for this. Fabricating own framework is just like re-inventing the wheel.
I am surprised. Even bloody PHP has built in functions to handle file uploads..
Thanks Ben. I guess I'll have to use Jakarta Commmons.
The Jakarta library is managed by the same foundation as Tomcat so, if this were built into the spec, the folks at Tomcat would probably be using these libraries anyway. And, since so many commercial containers use Apache libraries in their products (Jasper, for instance), it's probably safe to assume that they might also use the same code.