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

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