Bhavesh Vankar

Bhavesh Vankar

  • 725
  • 1.1k
  • 79.2k

webcam captured image convert and store in database in binary format

Jan 5 2021 7:16 AM
i have try to save captured image into binary format. The image is captured by webcam and image getting from another page on image control. i want to save this image into binary format in database.
 
 my tried code is below.
but i'm getting below error in FileStream line 02..... 
 
  1. Additional information: Access to the path 'K:\StudentManagment\StudentManagment' is denied.  
my tried code is below.
  1. string filepath = Server.MapPath(vImage.ImageUrl);  
  2.                     FileStream fs = new FileStream(filepath, FileMode.OpenOrCreate, FileAccess.ReadWrite);  
  3.                     BinaryReader br = new BinaryReader(fs);  
  4.                     Byte[] bytes = br.ReadBytes((Int32)fs.Length);  
  5.                     br.Close();  
  6.                     fs.Close();  
 

Answers (4)