Whenever converting the imagefile into bytes we got an error like
cannot access a closed file
Please help me in order to overcome this
private byte[] ConvertToBytes(HttpPostedFileBase file)
{
byte[] imageBytes = null;
BinaryReader reader = new BinaryReader(file.InputStream);
imageBytes = reader.ReadBytes((int)file.ContentLength);
return imageBytes;
}