using Swift.web.Library; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; namespace Swift.web.AgentNew { /// /// Summary description for GetIdPictureView /// public class GetIdPictureView : IHttpHandler { public void ProcessRequest(HttpContext context) { var imageName = context.Request.QueryString["fileName"]; var imgPath = GetStatic.GetAppRoot() + @"\Images\na.gif"; if (imageName == "" || imageName == null || imageName.Split('_').Length < 3) { context.Response.WriteFile(imgPath); } else { var fileName = context.Request.QueryString["fileName"]; var user = context.Request.QueryString["createdBy"]; imgPath = GetStatic.GetCustomerFilePath() + "CustomerDocument\\" + "ID Collection\\" + user +"\\"+ fileName; if (File.Exists(imgPath)) { context.Response.ContentType = imgPath; } else { context.Response.ContentType = GetStatic.ReadWebConfig("root", "") + "Images\\na.gif"; } } context.Response.WriteFile(context.Response.ContentType); } public bool IsReusable { get { return false; } } } }