Download file using Web Service WebMethod in ASP.Net

Last Reply on Sep 03, 2013 05:19 AM By Mudassar

Posted on Sep 03, 2013 05:19 AM

Download pdf file using webmothed

without erorr.  can't download  file .  Please help me.


what error .


    public static  string usernamecheck(string name, string amount, string floder, string getfile)
        string path = "PrintPDF.pdf";
        HttpContext.Current.Response.ContentType = "application/pdf";
        HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" + path);
       // HttpContext.Current.Response.WriteFile(HttpContext.Current.Server.MapPath(path));
         return ""; }

You are viewing reply posted by: Mudassar on Sep 03, 2013 05:19 AM.
Posted on Sep 03, 2013 05:19 AM

WebMethods cannot be used for Downloading file


I agree, here is the link: