pypmannetjies
pypmannetjies

Reputation: 31234

Managing file uploads in JSP/Servlets

Once again a very beginner-ish question, but here I go:

I would like to use a servlet or similar to copy an uploaded file (from an html file select) to a permanent location. This is all I need to do with the file. I am currently going with using the Apache Commons FileUpload and IO libraries. Is there no easier or more elegant solution?

Upvotes: 2

Views: 2073

Answers (3)

Pri
Pri

Reputation: 94

you can use OReilly’s COS library . refer this link!

Upvotes: 0

Eric Wendelin
Eric Wendelin

Reputation: 44349

The Servlet API has no way to extract the file from the POST (PUT?) data.

Just like Vincent said, Apache commons FileUpload is the best free way to do this.

You might also consider using a signed applet if you don't want to use the Apache libs.

Upvotes: 0

Vincent Ramdhanie
Vincent Ramdhanie

Reputation: 103135

The Apache commons FileUpload is probably the best way if you are using pure JSP and servlets. If you use a framework like struts2 you will have some more options since they have file upload components built in and are very easy to use.

Upvotes: 3

Related Questions