TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
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
Forums
Monthly Leaders
Forum guidelines
prabhu p
NA
181
113.8k
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