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 3.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. using System.Web.Optimization;
  4. namespace Teknik.Areas.Upload
  5. {
  6. public class UploadAreaRegistration : AreaRegistration
  7. {
  8. public override string AreaName
  9. {
  10. get
  11. {
  12. return "Upload";
  13. }
  14. }
  15. public override void RegisterArea(AreaRegistrationContext context)
  16. {
  17. context.MapSubdomainRoute(
  18. "Upload.Index",
  19. new List<string>() { "dev", "upload", "u" }, // Subdomains
  20. "",
  21. new { controller = "Upload", action = "Index" },
  22. new[] { typeof(Controllers.UploadController).Namespace }
  23. );
  24. context.MapSubdomainRoute(
  25. "Upload.Download",
  26. new List<string>() { "dev", "upload", "u" }, // Subdomains
  27. "{file}",
  28. new { controller = "Upload", action = "Download", file = string.Empty },
  29. new[] { typeof(Controllers.UploadController).Namespace }
  30. );
  31. context.MapSubdomainRoute(
  32. "Upload.Delete",
  33. new List<string>() { "dev", "upload", "u" }, // Subdomains
  34. "{file}/{key}",
  35. new { controller = "Upload", action = "Delete", file = string.Empty, key = string.Empty },
  36. new[] { typeof(Controllers.UploadController).Namespace }
  37. );
  38. context.MapSubdomainRoute(
  39. "Upload.Action",
  40. new List<string>() { "dev", "upload", "u" }, // Subdomains
  41. "Action/{controller}/{action}",
  42. new { controller = "Upload", action = "Index" },
  43. new[] { typeof(Controllers.UploadController).Namespace }
  44. );
  45. // Register Script Bundles
  46. BundleTable.Bundles.Add(new ScriptBundle("~/bundles/upload").Include(
  47. "~/Scripts/Dropzone/dropzone.js",
  48. "~/Areas/Upload/Scripts/Upload.js",
  49. "~/Scripts/bootstrap-switch.js",
  50. "~/Scripts/bootbox/bootbox.min.js"));
  51. BundleTable.Bundles.Add(new ScriptBundle("~/bundles/download").Include(
  52. "~/Scripts/Blob.js",
  53. "~/Scripts/FileSaver.js",
  54. "~/Areas/Upload/Scripts/Download.js"));
  55. BundleTable.Bundles.Add(new ScriptBundle("~/bundles/cryptoWorker").Include(
  56. "~/Areas/Upload/Scripts/EncryptionWorker.js"));
  57. BundleTable.Bundles.Add(new ScriptBundle("~/bundles/crypto").Include(
  58. "~/Scripts/Crypto-js/aes.js",
  59. "~/Scripts/Crypto-js/enc-base64.js",
  60. "~/Scripts/Crypto-js/mode-ctr.js",
  61. "~/Scripts/Crypto-js/lib-typedarrays.js",
  62. "~/Scripts/Crypto-js/pad-nopadding.js"));
  63. // Register Style Bundles
  64. BundleTable.Bundles.Add(new StyleBundle("~/Content/upload").Include(
  65. "~/Content/dropzone.css",
  66. "~/Content/bootstrap-switch/bootstrap3/bootstrap-switch.css",
  67. "~/Areas/Upload/Content/Upload.css"));
  68. }
  69. }
  70. }