This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

image uploading in database  RSS feed

 
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.
 
Marshal
Posts: 61756
193
  • 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.
 
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
 
author & internet detective
Posts: 38911
686
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!