1
Answer

error : Access is denied

prabhu p

prabhu p

8y
254
1
I trying download a excel file from path 
 
when i copy and paste path from variable "savepath" and paste in pc folder its works fine 
But i am getting error on this lne 
context.Response.WriteFile(savepath); 
 
 
[System.Web.Services.WebMethod(EnableSession = true)]
public void ProcessRequest(HttpContext context)
{
try
{
string savepath = "";
string tempPath = "";
tempPath = System.Configuration.ConfigurationManager.AppSettings["ManualExcel"];
savepath = context.Server.MapPath(tempPath);
context.Response.ContentType = "text/plain";
context.Response.AddHeader("Content-Disposition", "attachment; filename=" + "ManualEntry");
context.Response.WriteFile(savepath);
}
catch (Exception ex)
{
throw ex;
}
}
 
Please do need full to me 
Answers (1)
1
Nilesh Shah

Nilesh Shah

NA 22.3k 214.8k 7y
at least specify some details in your question.
 
what do you want?
 
if you yourself dont show interest in your question, who else will?