Bhavesh Vankar

Bhavesh Vankar

  • 755
  • 1.2k
  • 89.2k

How to replace Fileupload to Image.imageurl

Mar 10 2021 10:57 AM
how to replace Image1.ImageUrl to Fileupload1 in below code. 
  1. string filename = Path.GetFileName(FileUpload1.PostedFile.FileName);  
  2.            string contenttype = FileUpload1.PostedFile.ContentType;  
  3.   
  4.            using (Stream fs = FileUpload1.PostedFile.InputStream)  
  5.            {  
  6.                using (BinaryReader br = new BinaryReader(fs))  
  7.                {  
  8.                    byte[] bytes = br.ReadBytes((Int32)fs.Length);  
  9.        }  
  10.    }  
  11.  }  
 

Answers (3)