Bhavesh Vankar

Bhavesh Vankar

  • 732
  • 1.1k
  • 78.3k

image passing from one page to another on image control

Aug 2 2021 10:27 AM

i want to pass image after capture by webcam from one page to another page using c# web application and should be store in table in binary format...

image passing working fine from one page to another page while record save it occur error....image control is null. or path is incorrect..

what i have tried...

 code for store image in binary format.
 string imageVisitor = Server.MapPath(visitorImg.ImageUrl);
 FileStream fs = new FileStream(imageVisitor, FileMode.Open, FileAccess.ReadWrite);
 BinaryReader br = new BinaryReader(fs);
 byte[] bytesImage = br.ReadBytes(Convert.ToInt32(fs.Length));
 cmd.Parameters.AddWithValue("@V_IMAGE", bytesImage);


Answers (2)