Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Attaching files with JSP

  Asked By: Ketan    Date: Feb 09    Category: Java    Views: 1907

I'm trying to attach files using a "multipart/form-data" but I don't
know how to get the stream out of the posted file!!
Can anyone please help?

I tried to use the request.getReader() (which returs a
BufferedReader) and passed it inside a function in the bean in order
to create a parallel outputstream that will let me copy the
BufferedReader to a new file that I put on the server (this file is
the one to be sent as an attachment; it will be later a MimeBodyPart
for a multipart object...).

Another test using the request.getInputStream() was unsuccessful



4 Answers Found

Answer #1    Answered By: Leon Evans     Answered On: Feb 09

i guess you'd better use ready and released tags or libararies for
uploading your files, there are lots of them with documentations in
the Web. It would be an easy job for you;)

you can download Struts library from apache official nighlty

Answer #2    Answered By: Garai Chalthoum     Answered On: Feb 09

You can fine examples in java servlet programming and the site
in http://www.onJava.com and you can easily upload files  on your site. and if u
still get some problem you can ask again as i am also working on the same thing
but i am facing some problems in this area. anyways your simple uploading can be
done from the examples avaliable in this book.

Answer #3    Answered By: Caitlin Brown     Answered On: Feb 09

We are using File Upload Classes From http://www.jspsmart.com/

Answer #4    Answered By: Mamie Wallace     Answered On: Feb 09

I want to thank all those who replied to my request;

I successfully made the programming myself, not using any
already "cooked" implementation, and I'm happy with that;

My suggestion is: never get far from the "Java Cup"

Didn't find what you were looking for? Find more on Attaching files with JSP Or get search suggestion and latest updates.