Class FileStorageUtility  
  
  
    - Namespace
 - Raytha.Application.Common.Utils
 
  - Assembly
 - Raytha.Application.dll
 
   
  
  
  
    public static class FileStorageUtility
   
  
    - Inheritance
 
    - 
      
      
FileStorageUtility
     
  
  
    - Inherited Members
 
    - 
    
    
    
    
    
    
    
  
 
  Fields
  
  ALLOWED_MIMETYPES_CONFIG_NAME
  
  
  
  
  
    public const string ALLOWED_MIMETYPES_CONFIG_NAME = "FILE_STORAGE_ALLOWED_MIMETYPES"
   
  Field Value
  
    - string
 
    
  
  
  AZUREBLOB
  
  
  
  
  
    public const string AZUREBLOB = "azureblob"
   
  Field Value
  
    - string
 
    
  
  
  AZUREBLOB_CONNECTION_STRING_CONFIG_NAME
  
  
  
  
  
    public const string AZUREBLOB_CONNECTION_STRING_CONFIG_NAME = "FILE_STORAGE_AZUREBLOB_CONNECTION_STRING"
   
  Field Value
  
    - string
 
    
  
  
  AZUREBLOB_CONTAINER_CONFIG_NAME
  
  
  
  
  
    public const string AZUREBLOB_CONTAINER_CONFIG_NAME = "FILE_STORAGE_AZUREBLOB_CONTAINER"
   
  Field Value
  
    - string
 
    
  
  
  AZUREBLOB_CUSTOM_DOMAIN
  
  
  
  
  
    public const string AZUREBLOB_CUSTOM_DOMAIN = "FILE_STORAGE_AZUREBLOB_CUSTOM_DOMAIN"
   
  Field Value
  
    - string
 
    
  
  
  CONFIG_NAME
  
  
  
  
  
    public const string CONFIG_NAME = "FILE_STORAGE_PROVIDER"
   
  Field Value
  
    - string
 
    
  
  
  DATABASE_MAX_SIZE_CONFIG_NAME
  
  
  
  
  
    public const string DATABASE_MAX_SIZE_CONFIG_NAME = "DATABASE_MAX_SIZE"
   
  Field Value
  
    - string
 
    
  
  
  DEFAULT_ALLOWED_MIMETYPES
  
  
  
  
  
    public const string DEFAULT_ALLOWED_MIMETYPES = "text/*,image/*,video/*,audio/*,application/pdf"
   
  Field Value
  
    - string
 
    
  
  
  DEFAULT_DIRECT_UPLOAD_TO_CLOUD
  
  
  
  
  
    public const bool DEFAULT_DIRECT_UPLOAD_TO_CLOUD = true
   
  Field Value
  
    - bool
 
    
  
  
  DEFAULT_LOCAL_DIRECTORY
  
  
  
  
  
    public const string DEFAULT_LOCAL_DIRECTORY = "user-uploads"
   
  Field Value
  
    - string
 
    
  
  
  DEFAULT_MAX_FILE_SIZE
  
  
  
  
  
    public const long DEFAULT_MAX_FILE_SIZE = 20000000
   
  Field Value
  
    - long
 
    
  
  
  DEFAULT_MAX_TOTAL_DB_SIZE
  
  
  
  
  
    public const long DEFAULT_MAX_TOTAL_DB_SIZE = 1000000000
   
  Field Value
  
    - long
 
    
  
  
  DEFAULT_MAX_TOTAL_DISK_SPACE
  
  
  
  
  
    public const long DEFAULT_MAX_TOTAL_DISK_SPACE = 1000000000
   
  Field Value
  
    - long
 
    
  
  
  DIRECT_UPLOAD_TO_CLOUD_CONFIG_NAME
  
  
  
  
  
    public const string DIRECT_UPLOAD_TO_CLOUD_CONFIG_NAME = "FILE_STORAGE_DIRECT_UPLOAD_TO_CLOUD"
   
  Field Value
  
    - string
 
    
  
  
  LOCAL
  
  
  
  
  
    public const string LOCAL = "local"
   
  Field Value
  
    - string
 
    
  
  
  LOCAL_DIRECTORY_CONFIG_NAME
  
  
  
  
  
    public const string LOCAL_DIRECTORY_CONFIG_NAME = "FILE_STORAGE_LOCAL_DIRECTORY"
   
  Field Value
  
    - string
 
    
  
  
  MAX_FILE_SIZE_CONFIG_NAME
  
  
  
  
  
    public const string MAX_FILE_SIZE_CONFIG_NAME = "FILE_STORAGE_MAX_FILE_SIZE"
   
  Field Value
  
    - string
 
    
  
  
  MAX_TOTAL_DISK_SPACE_CONFIG_NAME
  
  
  
  
  
    public const string MAX_TOTAL_DISK_SPACE_CONFIG_NAME = "FILE_STORAGE_MAX_TOTAL_DISK_SPACE"
   
  Field Value
  
    - string
 
    
  
  
  S3
  
  
  
  
  
    public const string S3 = "s3"
   
  Field Value
  
    - string
 
    
  
  
  S3_ACCESS_KEY_CONFIG_NAME
  
  
  
  
  
    public const string S3_ACCESS_KEY_CONFIG_NAME = "FILE_STORAGE_S3_ACCESS_KEY"
   
  Field Value
  
    - string
 
    
  
  
  S3_BUCKET_CONFIG_NAME
  
  
  
  
  
    public const string S3_BUCKET_CONFIG_NAME = "FILE_STORAGE_S3_BUCKET"
   
  Field Value
  
    - string
 
    
  
  
  S3_SECRET_KEY_CONFIG_NAME
  
  
  
  
  
    public const string S3_SECRET_KEY_CONFIG_NAME = "FILE_STORAGE_S3_SECRET_KEY"
   
  Field Value
  
    - string
 
    
  
  
  S3_SERVICE_URL_CONFIG_NAME
  
  
  
  
  
    public const string S3_SERVICE_URL_CONFIG_NAME = "FILE_STORAGE_S3_SERVICE_URL"
   
  Field Value
  
    - string
 
    
  
  Methods
  
  
  CreateObjectKeyFromIdAndFileName(string, string)
  
  
  
  
  
    public static string CreateObjectKeyFromIdAndFileName(string id, string fileName)
   
  Parameters
  
    id string 
    
    fileName string 
    
  
  Returns
  
    - string
 
    
  
  
  
  GetAllowedFileExtensionsFromConfig(string)
  
  
  
  
  
    public static string[] GetAllowedFileExtensionsFromConfig(string csvFileExt)
   
  Parameters
  
    csvFileExt string 
    
  
  Returns
  
    - string[]
 
    
  
  
  
  GetDefaultExpiry()
  
  
  
  
  
    public static DateTime GetDefaultExpiry()
   
  Returns
  
    - DateTime
 
    
  
  
  
  GetMimeType(string)
  
  
  
  
  
    public static string GetMimeType(string fileName)
   
  Parameters
  
    fileName string 
    
  
  Returns
  
    - string