I am new to C# and reactjs and am stuck in this conundrum. I am using a function to download the images from url into my local file. Doing that I am specifying the file path.
The function is this:
[HttpPost]
[Route("GetImages")]
public IHttpActionResult GetImages()
{
Somewhere();
using (WebClient webClient = new WebClient())
{
var url = "https://firebasestorage.googleapis.com/v0/b/tsl-coil-qlty-
monitoring-dev.appspot.com/o/1a60ce3b-eddf-4e72-b2af-b6e99873e926?
alt=media&token=61399a02-1009-4bb9-ad89-d1235df900e4";
webClient.DownloadFile(url, @"D:\CQMS_Images_JPEG\image4.jpg");
}
return Ok();
}
The problem is I am specifying a file path in the function. Can it be made so that I do not need to specify the file path and it will get downloaded to a default location.
Please help also please let me know if this can be done with HTTP Response?
The file path that I am giving here is "D:\CQMS_Images_JPEG\image4.jpg"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.