The next generation of the Teknik Services. Written in ASP.NET.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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