Saving Image in Folder and path in database using Java

Saving Image in Folder and path in database using Java

Here is the code to get the image from the user and store it in a folder and store the image path in Database.

JSP and Servlet
MySql Database
Tested with Netbeans 8.0

Database – create table with name and photourl as fields with datatype varchar().

JSP: (Upload Image)

Servlet:

 

 

15 thoughts on “Saving Image in Folder and path in database using Java

  1. Sir I have used your code as mentioned above but at the time of retrieving image it wont display image on my jsp page….so please give me the solution….
    here is my code for retrieving the image:

    /*retrive.jsp */

    Insert title here

    <img src="” width=”300″ height=”300″ />

Leave a Reply

Your email address will not be published. Required fields are marked *