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.

UploadConfig.cs 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System.Collections.Generic;
  2. using System.IO;
  3. namespace Teknik.Configuration
  4. {
  5. public class UploadConfig
  6. {
  7. public bool UploadEnabled { get; set; }
  8. public bool DownloadEnabled { get; set; }
  9. // Max upload size in bytes
  10. public long MaxUploadSize { get; set; }
  11. // Max Upload Size for basic users
  12. public long MaxUploadSizeBasic { get; set; }
  13. // Max Upload Size for premium users
  14. public long MaxUploadSizePremium { get; set; }
  15. // Gets the maximum download size before they are forced to the download page
  16. public long MaxDownloadSize { get; set; }
  17. // Maximum total size for basic users
  18. public long MaxTotalSizeBasic { get; set; }
  19. // Maximum total size for basic users
  20. public long MaxTotalSizePremium { get; set; }
  21. // Location of the upload directory
  22. public string UploadDirectory { get; set; }
  23. // File Extension for saved files
  24. public string FileExtension { get; set; }
  25. public int UrlLength { get; set; }
  26. public int DeleteKeyLength { get; set; }
  27. public int KeySize { get; set; }
  28. public int BlockSize { get; set; }
  29. public bool IncludeExtension { get; set; }
  30. // The size of the chunk that the file will be encrypted/decrypted in (bytes)
  31. public int ChunkSize { get; set; }
  32. // Virus Scanning Settings
  33. public bool VirusScanEnable { get; set; }
  34. public string ClamServer { get; set; }
  35. public int ClamPort { get; set; }
  36. // Content Type Restrictions
  37. public List<string> RestrictedContentTypes { get; set; }
  38. public List<string> RestrictedExtensions { get; set; }
  39. public UploadConfig()
  40. {
  41. SetDefaults();
  42. }
  43. public void SetDefaults()
  44. {
  45. UploadEnabled = true;
  46. DownloadEnabled = true;
  47. MaxUploadSize = 100000000;
  48. MaxUploadSizeBasic = 100000000;
  49. MaxUploadSizePremium = 100000000;
  50. MaxDownloadSize = 100000000;
  51. MaxTotalSizeBasic = 1000000000;
  52. MaxTotalSizePremium = 5000000000;
  53. UploadDirectory = Directory.GetCurrentDirectory();
  54. FileExtension = "enc";
  55. UrlLength = 5;
  56. DeleteKeyLength = 24;
  57. KeySize = 256;
  58. BlockSize = 128;
  59. IncludeExtension = true;
  60. ChunkSize = 1024;
  61. VirusScanEnable = false;
  62. ClamServer = "localhost";
  63. ClamPort = 3310;
  64. RestrictedContentTypes = new List<string>();
  65. RestrictedExtensions = new List<string>();
  66. }
  67. }
  68. }