The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
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.

UploadAreaRegistration.cs 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. using System.Web.Mvc;
  2. using System.Web.Optimization;
  3. namespace Teknik.Areas.Upload
  4. {
  5. public class UploadAreaRegistration : AreaRegistration
  6. {
  7. public override string AreaName
  8. {
  9. get
  10. {
  11. return "Upload";
  12. }
  13. }
  14. public override void RegisterArea(AreaRegistrationContext context)
  15. {
  16. context.MapSubdomainRoute(
  17. "Upload.Index",
  18. "dev",
  19. "Upload",
  20. new { controller = "Upload", action = "Index" },
  21. new[] { typeof(Controllers.UploadController).Namespace }
  22. );
  23. context.MapSubdomainRoute(
  24. "Upload.Download",
  25. "dev",
  26. "Upload/{file}",
  27. new { controller = "Upload", action = "Download", url = string.Empty },
  28. new[] { typeof(Controllers.UploadController).Namespace }
  29. );
  30. context.MapSubdomainRoute(
  31. "Upload.Delete",
  32. "dev",
  33. "Upload/{file}/{key}",
  34. new { controller = "Upload", action = "Delete", url = string.Empty, deleteKey = string.Empty },
  35. new[] { typeof(Controllers.UploadController).Namespace }
  36. );
  37. context.MapSubdomainRoute(
  38. "Upload.Action",
  39. "dev",
  40. "Upload/Action/{controller}/{action}",
  41. new { controller = "Upload", action = "Index" },
  42. new[] { typeof(Controllers.UploadController).Namespace }
  43. );
  44. context.MapSubdomainRoute(
  45. "Upload.Index",
  46. "u",
  47. "",
  48. new { controller = "Upload", action = "Index" },
  49. new[] { typeof(Controllers.UploadController).Namespace }
  50. );
  51. context.MapSubdomainRoute(
  52. "Upload.Download",
  53. "u",
  54. "{url}",
  55. new { controller = "Upload", action = "Download", url = string.Empty },
  56. new[] { typeof(Controllers.UploadController).Namespace }
  57. );
  58. context.MapSubdomainRoute(
  59. "Upload.Delete",
  60. "u",
  61. "{url}/{deleteKey}",
  62. new { controller = "Upload", action = "Delete", url = string.Empty, deleteKey = string.Empty },
  63. new[] { typeof(Controllers.UploadController).Namespace }
  64. );
  65. context.MapSubdomainRoute(
  66. "Upload.Action",
  67. "u",
  68. "Action/{controller}/{action}",
  69. new { controller = "Upload", action = "Index" },
  70. new[] { typeof(Controllers.UploadController).Namespace }
  71. );
  72. context.MapSubdomainRoute(
  73. "Upload.Index",
  74. "upload",
  75. "",
  76. new { controller = "Upload", action = "Index" },
  77. new[] { typeof(Controllers.UploadController).Namespace }
  78. );
  79. context.MapSubdomainRoute(
  80. "Upload.Download",
  81. "upload",
  82. "{url}",
  83. new { controller = "Upload", action = "Download", url = string.Empty },
  84. new[] { typeof(Controllers.UploadController).Namespace }
  85. );
  86. context.MapSubdomainRoute(
  87. "Upload.Delete",
  88. "upload",
  89. "{url}/{deleteKey}",
  90. new { controller = "Upload", action = "Delete", url = string.Empty, deleteKey = string.Empty },
  91. new[] { typeof(Controllers.UploadController).Namespace }
  92. );
  93. context.MapSubdomainRoute(
  94. "Upload.Action",
  95. "upload",
  96. "Action/{controller}/{action}",
  97. new { controller = "Upload", action = "Index" },
  98. new[] { typeof(Controllers.UploadController).Namespace }
  99. );
  100. // Register Script Bundles
  101. BundleTable.Bundles.Add(new ScriptBundle("~/bundles/upload").Include(
  102. "~/Scripts/Dropzone/dropzone.js",
  103. "~/Areas/Upload/Scripts/Upload.js",
  104. "~/Scripts/bootbox/bootbox.min.js"));
  105. BundleTable.Bundles.Add(new ScriptBundle("~/bundles/download").Include(
  106. "~/Scripts/Blob.js",
  107. "~/Scripts/FileSaver.js",
  108. "~/Areas/Upload/Scripts/Download.js"));
  109. BundleTable.Bundles.Add(new ScriptBundle("~/bundles/cryptoWorker").Include(
  110. "~/Areas/Upload/Scripts/EncryptionWorker.js"));
  111. BundleTable.Bundles.Add(new ScriptBundle("~/bundles/crypto").Include(
  112. "~/Scripts/Crypto-js/aes.js",
  113. "~/Scripts/Crypto-js/enc-base64.js",
  114. "~/Scripts/Crypto-js/mode-ctr.js",
  115. "~/Scripts/Crypto-js/lib-typedarrays.js",
  116. "~/Scripts/Crypto-js/pad-nopadding.js"));
  117. // Register Style Bundles
  118. BundleTable.Bundles.Add(new StyleBundle("~/Content/upload").Include(
  119. "~/Content/dropzone.css",
  120. "~/Areas/Upload/Content/Upload.css"));
  121. }
  122. }
  123. }