2
Answers

how to save default image into data base

satheesh babu

satheesh babu

15y
3.1k
1

hi all,

Here i have one image control,one fileupload control and a save button and display button.
Here i am saving the image into data base using file upload control and below is my code to save

Stream ImageStream = file1.PostedFile.InputStream;
int len = file1.PostedFile.ContentLength;
byte[] ImageContent = new byte[len];
ImageStream.Read(ImageContent, 0, len);
objMembership.Memimage = ImageContent;

the above code works when user select an image using fileupload control.

now my problem is if user don't select any image using fileupload control then i need to save a default image into data base.

and i am displaying a default image in image control every time when form is loading.....

if user doesn't select any image from fileupload i need to save that default image into data base

or how can we set default path for fileupload control.


Please help me out how to do this...

Answers (2)