File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Upload image to server using JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Upload image to server using JSP" Watch "Upload image to server using JSP" New topic

Upload image to server using JSP

kenji jonathan

Joined: Oct 07, 2011
Posts: 4

Hi friends, I want to ask, how to upload image to server using JSP?...thanks.
Paul Clapham

Joined: Oct 14, 2005
Posts: 19553

Don't use a JSP. The purpose of a JSP is to generate output in a text format, usually HTML. Clearly that purpose doesn't encompass uploading files. You should use a servlet to do that.

And the easiest way to do it in a servlet is to use the Apache File Upload package.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62756

See the JspFaq for more info.

And Paul is correct, Java code in a JSP is nothing short of irresponsible at this stage.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
It is sorta covered in the JavaRanch Style Guide.
subject: Upload image to server using JSP