Bhavesh Vankar

Bhavesh Vankar

  • 764
  • 1.1k
  • 88.1k

How to store image into directory which is captured by webcam ?

Mar 24 2022 8:30 AM

i want to store image in directory, image is captured by webcam and cropped as per requirments and displayed in image controls. using c# web application.

all thinds are working fine but now i want to store that image into perticular directory.

how to do it...i have search on google but not done....

i want to store that image datewise directory....

if current date directory is not exist that it will create first current date directory and that it will store in that current date directory.

Main Directory + Current date Directory / Image with current date name...

i have created below code to create directory.... but issue is captured and displayed image through session how to store it in directory...

                string MainDir = @"~/MainDirectory/";
                String SubDir = DateTime.Now.ToString("dd-MM-yyyy");
                if (!Directory.Exists(Server.MapPath(MainDir + SubDir + "/")))
                {
                    Directory.CreateDirectory(Server.MapPath(MainDir + SubDir + "/"));
                }

 


Answers (2)