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

Download pdf file using webmothed asp.net

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

 

what error .

 

  [WebMethod]
    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));
        HttpContext.Current.Response.TransmitFile(HttpContext.Current.Server.MapPath(path));
        //HttpContext.Current.Response.End();
   
         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