• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

image uploading in database

 
Lalit Chattar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one send me how upload multiple image from one html form and jsp/servlet. i use db2 database and blob datatype.

its urgent please reply anyone..........

thank in advance.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50277
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Never say anything is urgent. Question too difficult for "beginning". Moving thread to our databases forum.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. use Apache commons-upload jars

2. parse the request and get the FileItem (!isFormField())

3.get the InputStream from the FileItem

4.finally read and write the Image



5. and store the image location on server to the DB as a varchar(preferrable)

P.S. make the enctype of the jsp form attribute as "multipart/form-data"

Hope this helps
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and Welcome to Javaranch Lalit Chattar
 
Lalit Chattar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seetharaman venkatasamy wrote:1. use Apache commons-upload jars

2. parse the request and get the FileItem (!isFormField())

3.get the InputStream from the FileItem

4.finally read and write the Image



5. and store the image location on server to the DB as a varchar(preferrable)

Hope this helps


Thank you sir,

once i want to know that , can we send text value with multipart/form-data ...like profile...we can send image with text in he same form...and for above imformation give me some detail..
P.S. make the enctype of the jsp form attribute as "multipart/form-data"

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lalit Chattar wrote: can we send text value with multipart/form-data ...like profile...


Yes. you can...
 
Lalit Chattar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seetharaman venkatasamy wrote:
Lalit Chattar wrote: can we send text value with multipart/form-data ...like profile...


Yes. you can...



How ? please give me example with jsp code and snapshot....


thank you
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please , Show Some Effort
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34974
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lalit Chattar wrote:How ? please give me example with jsp code and snapshot....

Seetharaman outlines the steps. Start by trying them and posting when you have a question. Were you able to pull in the recommended jar? etc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic