Quote:
Originally Posted by bhutanesedude
GNow I want it to be able to insert it's photo (Passport Size Photo) and retrive it whenever required. Well, I know that in DB Table the field type should be "image" but I want to know what should I write behind the coding of "upload" button to save that BROWSED image into the particular database.
|
its very simple...
declare a variable array of type byte.
e.g:
byte[] imageSize = new byte[FileUpload1.PostedFile.ContentLength];
HttpPostedFile uploadedImage = FileUpload1.PostedFile;
uploadedImage.InputStream.Read(imageSize, 0, (int)FileUpload1.PostedFile.ContentLength);
then use dynamic sql query "insert into..." or stored procedure....pass the
parameter uploadedImage to the Command Text
thats it.