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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. // Location of the upload directory
  15. public string UploadDirectory { get; set; }
  16. // File Extension for saved files
  17. public string FileExtension { get; set; }
  18. public int UrlLength { get; set; }
  19. public int DeleteKeyLength { get; set; }
  20. public int KeySize { get; set; }
  21. public int BlockSize { get; set; }
  22. public bool IncludeExtension { get; set; }
  23. // The size of the chunk that the file will be encrypted/decrypted in (bytes)
  24. public int ChunkSize { get; set; }
  25. // Virus Scanning Settings
  26. public bool VirusScanEnable { get; set; }
  27. public string ClamServer { get; set; }
  28. public int ClamPort { get; set; }
  29. public UploadConfig()
  30. {
  31. SetDefaults();
  32. }
  33. public void SetDefaults()
  34. {
  35. UploadEnabled = true;
  36. DownloadEnabled = true;
  37. MaxUploadSize = 100000000;
  38. UploadDirectory = Directory.GetCurrentDirectory();
  39. FileExtension = "enc";
  40. UrlLength = 5;
  41. DeleteKeyLength = 24;
  42. KeySize = 256;
  43. BlockSize = 128;
  44. IncludeExtension = true;
  45. ChunkSize = 1024;
  46. VirusScanEnable = false;
  47. ClamServer = "localhost";
  48. ClamPort = 3310;
  49. }
  50. }
  51. }