/ Published in: C#
Expand |
Embed | Plain Text
<%@ WebHandler Language="C#" Class="MyApplication" %> using System; using System.Web; using System.IO; public class MyApplication : IHttpHandler { public void ProcessRequest (HttpContext context) { ProfileCommon profile = (ProfileCommon)context.Profile; if (profile.ApplicationID != default(Guid)) { var filePath = string.Format("{0}{1}.pdf", SettingsManager.Forms.GetApplicationStoragePath(), profile.ApplicationID.ToString()); if (File.Exists(filePath)) { context.Response.ContentType = "application/pdf"; context.Response.WriteFile(filePath); context.Response.End(); } } else { context.Response.ContentType = "text/plain"; context.Response.Write("Could not open document."); } } public bool IsReusable { get { return true; } } }
You need to login to post a comment.
