You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

53 lines
1.9 KiB

using Swift.web.Library;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
namespace Swift.web.AgentNew
{
/// <summary>
/// Summary description for GetFileViewNew
/// </summary>
public class GetFileViewNew : 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 < 6)
{
context.Response.WriteFile(imgPath);
}
else
{
var registerDate = context.Request.QueryString["registerDate"];
var customerId = context.Request.QueryString["customerId"];
var membershipNo = context.Request.QueryString["membershipNo"];
var fileName = context.Request.QueryString["fileName"];
DateTime txnDate = Convert.ToDateTime(registerDate);
//imgPath = GetStatic.GetCustomerFilePath() + "CustomerDocument\\" + registerDate.Replace("-", "\\") + "\\" + membershipNo + "\\" + fileName;
imgPath = Path.Combine(GetStatic.GetCustomerFilePath(), "CustomerDocument", registerDate.Replace("-", "/"), membershipNo, 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;
}
}
}
}