Thank you for posting at Dotnetfunda [Administrator]
Today is a gift. That's why it's called the Present!
using System.Drawing;Bitmap b = (Bitmap)Bitmap.FromStream(file.InputStream);using (MemoryStream ms = new MemoryStream()) { b.Save(ms, ImageFormat.Png); // use the memory stream to base64 encode..}
FileStream FS = new FileStream(filepath, FileMode.Open, FileAccess.Read); //create a file stream object associate to user selected file byte[] img = new byte[FS.Length]; //create a byte array with size of user select file stream lengthFS.Read(img, 0, Convert.ToInt32(FS.Length));//read user selected file stream in to byte array
Login to post response