Upload Image and field data using jsp and servlet

i want to upload upload image and field data using jsp servelt
want to store image in folder
and data in database

<form action="upload" method="post" enctype="multipart/form-data">
    <input type="text" name="description" />
    <input type="file" name="file" />
    <input type="submit" />
</form>

i know how to store data in database
i know how to create folder

but

when i upload image using enctype="multipart/form-data" the field data became null and image upload successfuly
if remove enctype="multipart/form-data" field data works fine but image didnt upload because of enctype="multipart/form-data"

Need Solution


Source: jsp

Leave a Reply