Итак, у меня есть веб-приложение ASP.NET в c #.Я создал метод для загрузки файлов, и он отлично работает.В настоящее время он загружает файлы на диск D, как я указал на этом пути.Тем не менее, я хочу, чтобы файлы были загружены в Local Pictures Library.Ниже приведены мои коды:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Download")
{
Response.Clear();
Response.ContentType = "application/octect-stream";
Response.AppendHeader("content-disposition", "filename=" + e.CommandArgument);
Response.TransmitFile(Server.MapPath("~/Images/") + e.CommandArgument);
WebClient webClient = new WebClient();
//How to add path for pictures library in local machine?
webClient.DownloadFile(Server.MapPath("~/Images/") + e.CommandArgument, @"d:\myfile.jpg");
Response.End();
}
}