How to upload allow user select their image file and upload into database?
Posted on 2003-02-25
I have created javabean for connection and a few other javabeans such as dbHobby and dbMemeber, which make use of the connection javabean. dbHobby will have prepared Statement that perform insert, delete, edit or select values into or from Hobby table, same as for dbMember.
For now, i am creating a website, my database is mysql.
Can anyone teach me how can i enable user to click browse, then they can select their img file from their own computer, and upload and store the image into mysql database?
And from my database, how can i retrieve the image and display it into my jsp?
I heard of something such as blob, but really dont know how to code it. Will appreciate if someone can provide me some sample coding for uploading of image.
I am still trying to learn java as i have just pick this language up on my own for quite a short period only. Hope you experts out there can kindly help me. Thanks