Click here to Skip to main content
15,895,142 members

Comments by Ravindra Nidhonkar (Top 1 by date)

Ravindra Nidhonkar 23-May-11 2:35am View    
You are doing wrong thing. Check the below code again:

Stream imgStream = FileUpload1.PostedFile.InputStream;
BinaryReader imgBinary = new BinaryReader(imgStream);
Byte[] bytes = imgBinary.ReadBytes((Int32)imgStream.Length);
string imgBinary = Convert.ToBase64String(bytes);