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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. // Location of the upload directory
  18. public string UploadDirectory { get; set; }
  19. // File Extension for saved files
  20. public string FileExtension { 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 bool VirusScanEnable { get; set; }
  30. public string ClamServer { get; set; }
  31. public int ClamPort { get; set; }
  32. // Content Type Restrictions
  33. public List<string> RestrictedContentTypes { get; set; }
  34. public List<string> RestrictedExtensions { get; set; }
  35. public UploadConfig()
  36. {
  37. SetDefaults();
  38. }
  39. public void SetDefaults()
  40. {
  41. UploadEnabled = true;
  42. DownloadEnabled = true;
  43. MaxUploadSize = 100000000;
  44. MaxUploadSizeBasic = 100000000;
  45. MaxUploadSizePremium = 100000000;
  46. MaxDownloadSize = 100000000;
  47. UploadDirectory = Directory.GetCurrentDirectory();
  48. FileExtension = "enc";
  49. UrlLength = 5;
  50. DeleteKeyLength = 24;
  51. KeySize = 256;
  52. BlockSize = 128;
  53. IncludeExtension = true;
  54. ChunkSize = 1024;
  55. VirusScanEnable = false;
  56. ClamServer = "localhost";
  57. ClamPort = 3310;
  58. RestrictedContentTypes = new List<string>();
  59. RestrictedExtensions = new List<string>();
  60. }
  61. }
  62. }