wood burning stoves 2.0*
The moose likes Servlets and the fly likes Upload image in database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Upload image in database" Watch "Upload image in database" New topic
Author

Upload image in database

abhijeet srivastava
Greenhorn

Joined: Aug 22, 2006
Posts: 26
Hi all!

How is that possible to upload image in database table by selecting image file in FileChooser.I want to upload imgage file, not its name.

Thanks.
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by abhijeet srivastava:
Hi all!

How is that possible to upload image in database table by selecting image file in FileChooser.I want to upload imgage file, not its name.

Thanks.


As images are binary..you can put the binary content in BLOB filed.Upload the image to server and then use a servlet to upload its binary content to database. I do not know if this would be efficient.


Rahul Bhattacharjee
LinkedIn - Blog
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

The JSP FAQ has an entry explaining file uploading.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Consider Paul's rocket mass heater.
 
subject: Upload image in database