This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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

Win a copy of Elasticsearch in Action this week in the Big Data forum!
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: 19351

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: 62138

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]
I agree. Here's the link:
subject: Upload image to server using JSP