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.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. public int UrlLength { get; set; }
  22. public int DeleteKeyLength { get; set; }
  23. public int KeySize { get; set; }
  24. public int BlockSize { get; set; }
  25. public bool IncludeExtension { get; set; }
  26. // The size of the chunk that the file will be encrypted/decrypted in (bytes)
  27. public int ChunkSize { get; set; }
  28. // Virus Scanning Settings
  29. public ClamConfig ClamConfig { get; set; }
  30. // Hash Scanning Settings
  31. public HashScanConfig HashScanConfig { get; set; }
  32. // Storage settings
  33. public StorageConfig StorageConfig { get; set; }
  34. // Content Type Restrictions
  35. public List<string> RestrictedContentTypes { get; set; }
  36. public List<string> RestrictedExtensions { get; set; }
  37. public UploadConfig()
  38. {
  39. SetDefaults();
  40. }
  41. public void SetDefaults()
  42. {
  43. UploadEnabled = true;
  44. DownloadEnabled = true;
  45. MaxUploadSize = 100000000;
  46. MaxUploadSizeBasic = 100000000;
  47. MaxUploadSizePremium = 100000000;
  48. MaxDownloadSize = 100000000;
  49. MaxTotalSizeBasic = 1000000000;
  50. MaxTotalSizePremium = 5000000000;
  51. UrlLength = 5;
  52. DeleteKeyLength = 24;
  53. KeySize = 256;
  54. BlockSize = 128;
  55. IncludeExtension = true;
  56. ChunkSize = 1024;
  57. ClamConfig = new ClamConfig();
  58. HashScanConfig = new HashScanConfig();
  59. StorageConfig = new StorageConfig("uploads");
  60. RestrictedContentTypes = new List<string>();
  61. RestrictedExtensions = new List<string>();
  62. }
  63. }
  64. }