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.

39 lines
1.2 KiB

  1. using Swift.web.Library;
  2. using System.IO;
  3. using System.Web;
  4. namespace Swift.web.Remit.Administration.OnlineCustomer
  5. {
  6. /// <summary>
  7. /// Summary description for VerifyDocuments
  8. /// </summary>
  9. public class GetDocumentView : IHttpHandler
  10. {
  11. public void ProcessRequest(HttpContext context)
  12. {
  13. var imageName = context.Request.QueryString["imageName"];
  14. var customerId = context.Request.QueryString["customerId"];
  15. var fileType = context.Request.QueryString["fileType"];
  16. var imgPath = GetStatic.GetAppRoot() + @"\Images\na.gif";
  17. var file = GetStatic.GetFilePath() + "CustomerDocument\\" + customerId + "\\" + imageName;
  18. bool a = fileType.Contains("image");
  19. if (File.Exists(file) && a)
  20. {
  21. imgPath = file;
  22. context.Response.ContentType = fileType;
  23. }
  24. else
  25. {
  26. context.Response.ContentType = fileType;
  27. }
  28. context.Response.WriteFile(imgPath);
  29. }
  30. public bool IsReusable
  31. {
  32. get
  33. {
  34. return false;
  35. }
  36. }
  37. }
  38. }