tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "CPC Livelink Admin" <cpclv...@fitzpatrick.cc>
Subject RE: Getting servletinputStream from a specific field of the posted form?
Date Sun, 26 Nov 2000 14:42:18 GMT

You need to get a multi-part post data handler.  There is one at
www.servlets.com (the O'Reilly servlets site) which is not wuite free (must
buy the book to use it commercially), but does work well.  If you browse the
archive, (http://marc.theaimsgroup.com/?l=tomcat-user&r=1&w=2 is one
archive), then you can search for other messages on this topic which show up
periodically.

Regards,
Paul


-----Original Message-----
From: Kirasawa, Mike [mailto:winframe@iname.com]
Sent: Sunday, November 26, 2000 03:57 PM
To: tomcat-user@jakarta.apache.org
Subject: Getting servletinputStream from a specific field of the posted
form?


Hello

A small question, hopefully this is completely JSP-related (I think it is).
I have a form where a couple of the fields are of type <INPUT TYPE=FILE>,
which are used to upload images etc.

I would like to get the files posted through these two fields, and save them
to a pre-determined folder on the server. I came across something called:

     request.getInputStream();

but how would I specify exactly which file I wish to save?

I am a bit clueless here, and would appreciate a few pointers. I know that I
can write to a file by using a FileOutputStream, but before I can "put" a
file like this, I need to "get" the bytes from the posted form. Is there
anyway to get this? Request.getparameter just returns me a string, right?

Thanks a lot in advance,
Shanx





Mime
View raw message