我正在尝试从本地主机中的计算机下载文件。但我不断收到错误
System.UnauthorizedAccessException: Access to the path 'c:\users\zunair\documents\visual studio 2012\Projects\WebApplication2\WebApplication2\Uploads' is denied.
这是我的代码
if (FileExt == ".pdf")
{
Response.ContentType = "Application/pdf";
Response.AppendHeader("Content-Disposition", "attachment; filename=FileName");
Response.TransmitFile(Server.MapPath("~/Uploads" + FileName));
Response.End();
}
我得到错误Response.TransmitFile(Server.MapPath("~/Uploads" + FileName));