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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 int 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. public UploadConfig()
  26. {
  27. SetDefaults();
  28. }
  29. public void SetDefaults()
  30. {
  31. UploadEnabled = true;
  32. DownloadEnabled = true;
  33. MaxUploadSize = 100000000;
  34. UploadDirectory = Directory.GetCurrentDirectory();
  35. FileExtension = "enc";
  36. UrlLength = 5;
  37. DeleteKeyLength = 24;
  38. KeySize = 256;
  39. BlockSize = 128;
  40. IncludeExtension = true;
  41. ChunkSize = 1024;
  42. }
  43. }
  44. }