Watch Pre-recorded Live Shows Here
Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
prabhu p
2k
181
98.1k
error : Access is denied
Nov 23 2016 9:24 AM
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
Reply
Answers (
1
)
SAML data reading
Sorting functionality for header in asp.net mvc