jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes image uploading in database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "image uploading in database" Watch "image uploading in database" New topic
Author

image uploading in database

Lalit Chattar
Greenhorn

Joined: Oct 22, 2009
Posts: 11
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

Joined: Oct 13, 2005
Posts: 38784
    
  23
Welcome to the Ranch

Never say anything is urgent. Question too difficult for "beginning". Moving thread to our databases forum.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Jan 28, 2008
Posts: 5575

and Welcome to Javaranch Lalit Chattar
Lalit Chattar
Greenhorn

Joined: Oct 22, 2009
Posts: 11
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

Joined: Jan 28, 2008
Posts: 5575

Lalit Chattar wrote: can we send text value with multipart/form-data ...like profile...


Yes. you can...
Lalit Chattar
Greenhorn

Joined: Oct 22, 2009
Posts: 11
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

Joined: Jan 28, 2008
Posts: 5575

Please , Show Some Effort
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30512
    
150

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: image uploading in database