I want to download video file and save it to the project folder. Here is my current code for the video download and save it to a folder.
string savePath = Server.MapPath("DownloadedClip/Record1.mp4");
//Delete existing file
if (File.Exists(savePath))
{
File.Delete(savePath);
}
//Create a new file
using (File.Create(savePath)) //Exception Occur here
{
using (WebClient wc = new WebClient())
wc.DownloadFile(url, savePath);
}
When I run the project it throws an exception as "Could not find a part of the path." How can I solve the issue?
Appreciate your help with this.
Thank You.