filename = Path.GetFileName(FileUpload.FileName);
HttpPostedFile pf = FileUpload.PostedFile;
System.Drawing.Image img2 = System.Drawing.Image.FromStream(pf.InputStream);
System.Drawing.Image bmp2 = img2.GetThumbnailImage(200, 210, null, IntPtr.Zero);
Imagename = objUser.UserID + filename;
Imagepath = "D:\\Shopy_Web_21-6-12\\Shopy\\Images" + Imagename;
bmp2.Save(Path.Combine(@"D:\Shopy_Web_21-6-12\Shopy\Images", Imagename));
I’ve converted the file upload in to two thumbnails and saved them locally, but now I need retrieve the image to display it on the user’s profile. How can I get the image to display from where I’ve stored it?
You can create a virtual path in your application say:
..Images/and save your images in that folder.and after that use the below one to fetch the image URL:
Now you will get the url to your image that can be displayed directly.