Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Upload image to server using JSP

 
kenji jonathan
Greenhorn
Posts: 4
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends, I want to ask, how to upload image to server using JSP?...thanks.
 
Paul Clapham
Sheriff
Posts: 21126
32
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the JspFaq for more info.

And Paul is correct, Java code in a JSP is nothing short of irresponsible at this stage.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic