Results 1 to 8 of 8
Thread: Image Upload,Please help
- 04-28-2011, 01:21 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 18
- Rep Power
- 0
Image Upload,Please help
I am making a very simple website as my minor project, in which i will ask user to upload photo and save it in the BLOB field of my database.
I have created a form.
Now please help me how to fetche the image in servlet and store in BLOB field of Database.Java Code:<form action="SavePic" method="post" enctype="multipart/form-data" name="productForm" id="productForm"> Please Upload Your Profile Picture <input type="file" name="file" id="file"> <input type="submit" name="Submit" value="Submit"> </form>
I am stuck, please Help!!|SCJP-1.6 91%|
- 04-28-2011, 01:23 PM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 05-15-2011, 12:44 AM #3
Member
- Join Date
- Oct 2010
- Posts
- 32
- Rep Power
- 0
hi JavaDreams.
Use apache upload commons to fetch the file from the client side to the server. It comes with a pretty good documentation, and you won't have too much problem in writing the servlet (as u're signature suggests!). Rest inserting it into the database is a pretty easy! ..try it
good luck :)
- 05-15-2011, 09:54 AM #4
Member
- Join Date
- Jan 2011
- Posts
- 18
- Rep Power
- 0
- 05-22-2011, 08:45 PM #5
Member
- Join Date
- Jan 2011
- Posts
- 18
- Rep Power
- 0
With all your guidence i am able to getting a image file uploaded and save it in a folder on my disk.
Bust just a single error.
When i upload image, it doesn't come when i call it with the <Img> tag. But when i run the whole program again it comes.
So am i missing any thing??|SCJP-1.6 91%|
- 05-22-2011, 09:27 PM #6
Member
- Join Date
- Oct 2010
- Posts
- 32
- Rep Power
- 0
Hi javadreams,
good to hear that!!... :oWith all your guidence i am able to getting a image file uploaded and save it in a folder on my disk.
if u have succeeded in uploading the image, displaying it with the image tag shouldn't be a problem after a refresh. image tag just displays the image as specified by its src attribute...that's the concept and that's how things work.
U must be missing something which is not clear to me....so please elaborate your problem a bit, specially when i run the whole program part or check your code once again...ok??
good luck!
- 06-28-2011, 10:53 PM #7
Member
- Join Date
- Jan 2011
- Posts
- 18
- Rep Power
- 0
Thank you everyone and specially Go4Somya with all your help, i was able and submitted my project
SOCIAL NETWORKING WEBSITE successfully.
Thanks a lot once agai.
.gif)
.gif)
.gif)
.gif)
|SCJP-1.6 91%|
- 07-21-2011, 06:08 AM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Could you please mark the thread solved then?
Similar Threads
-
How to upload image in jsp/servlet
By ibhaviik in forum Java ServletReplies: 11Last Post: 11-16-2010, 11:32 AM -
Upload Image / Document
By systech44 in forum Java ServletReplies: 1Last Post: 09-02-2010, 02:10 PM -
Upload an image.
By dudejonne in forum Java AppletsReplies: 13Last Post: 11-11-2009, 06:04 PM -
How to upload image into server
By vinodkonatala in forum Advanced JavaReplies: 2Last Post: 10-15-2008, 12:10 PM -
Image upload applet 2.0
By jfileupload in forum Java SoftwareReplies: 0Last Post: 03-24-2008, 04:15 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks