Hi Dear,
Here I am trying to upload a photo.
I have created virtual directory and trying to open it directly from browser
Here I am trying to upload a photo.
Code:
protected void LoadImage() {
string UserName = Session["UserName"].ToString();
byte[] Data = Profile.GetImageData(UserName); //Stmt Correct where profile is class
if (Data != null)
{
MemoryStream stream = new MemoryStream(Data);
Bitmap bitmap = null;
bitmap = new Bitmap(stream);
bitmap.Save(Server.MapPath(@"~\UserPhoto.bmp"), system.Drawing.Imaging.ImageFormat.Bmp);
//Error:A Generic Error occurred in GDI+
bitmap.Dispose();
imgPhoto.ImageUrl = @"~\UserPhoto.bmp"; } }
I have created virtual directory and trying to open it directly from browser
Comment