Open file from server and send to browser
2 answers
you can save the file to a folder and then give the user a page where they can click the link to download the file. just remember to create a unique name for the file (using guid), otherwise users will download each other.
you can also return the file in response. the following code is for returning an excel file, but it can be easily modified for pdf.
Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("Content-Disposition", string.Format("attachment; filename={0}", fileName));
Response.TransmitFile(Server.MapPath(string.Format("{0}/{1}", BasePath, fileName)));
+3
a source to share