Tuesday, November 12, 2013

Open and Save As Dialog Boxes / Propmt Dialog Box

Here i have posted code for download and open dialog code using Asp.net with C#.
if u have already created file or open file using this code, and client can save and download file
using this.
  
 Response.Clear();
 Response.ContentType = "application/pdf";
 Response.AppendHeader("Content-Disposition", "attachment; filename=yourfilename.pdf");
 Response.TransmitFile(Server.MapPath("~/DirectoryName/yourfilename.pdf"));
Hey gusys, here you can add ContentType as per your file format. Note:Don't use blank space between your file name.

No comments:

Post a Comment