Secure Exchanges SDK Documentation
Search Results for

    Show / Hide Table of Contents

    Class FileHelper

    This is the Helper need to be use for upload and download files to Secure Exchanges. This Helper will decrypt the files, and encrypt them

    Inheritance
    object
    FileHelper
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: SecureExchangesSDK.Helpers
    Assembly: SecureExchangesSDK.dll
    Syntax
    public class FileHelper

    Methods

    DownloadSecureFiles(SecureFiles, List<DownloadedFileWithMetaData>)

    Declaration
    public void DownloadSecureFiles(SecureFiles filesMetaData, List<DownloadedFileWithMetaData> files)
    Parameters
    Type Name Description
    SecureFiles filesMetaData
    List<DownloadedFileWithMetaData> files

    DownloadSecureFiles(SecureFiles, string, object)

    Declaration
    public void DownloadSecureFiles(SecureFiles filesMetaData, string savingDirectory, object paramsToFile = null)
    Parameters
    Type Name Description
    SecureFiles filesMetaData
    string savingDirectory
    object paramsToFile

    GetExtensionsByMimeType(string)

    Return a list of extensions based on the mimeType

    Declaration
    public static string[] GetExtensionsByMimeType(string mimeType)
    Parameters
    Type Name Description
    string mimeType
    Returns
    Type Description
    string[]

    GetMimeType(string)

    Get the mime type of an extension

    Declaration
    public static string GetMimeType(string fileNameOrExtension)
    Parameters
    Type Name Description
    string fileNameOrExtension
    Returns
    Type Description
    string

    return the mime type of the extension

    Examples
    string mimeType=  FileHelper.GetMimeType(".jpg");
    // mimeType  = "image/jpeg"

    GetNumberOfChunk(long)

    Declaration
    public static double GetNumberOfChunk(long totalBytes)
    Parameters
    Type Name Description
    long totalBytes
    Returns
    Type Description
    double

    GetTextSize(long)

    That will return in text the Size of a file

    Declaration
    public static string GetTextSize(long bytes)
    Parameters
    Type Name Description
    long bytes

    Size of the file

    Returns
    Type Description
    string

    The formated file size ie: 50 MB or 103 Bytes

    Examples
    FileHelper.GetTextSize(fileSize)

    PrepareFileToDownload(FileMetaData, string, object)

    Declaration
    public DownloadedFileWithMetaData PrepareFileToDownload(FileMetaData fileMetaData, string savingDirectory, object paramsToFile = null)
    Parameters
    Type Name Description
    FileMetaData fileMetaData
    string savingDirectory
    object paramsToFile
    Returns
    Type Description
    DownloadedFileWithMetaData

    PrepareFileToDownload(SecureFiles, string, object)

    Declaration
    public List<DownloadedFileWithMetaData> PrepareFileToDownload(SecureFiles filesMetaData, string savingDirectory, object paramsToFiles = null)
    Parameters
    Type Name Description
    SecureFiles filesMetaData
    string savingDirectory
    object paramsToFiles
    Returns
    Type Description
    List<DownloadedFileWithMetaData>

    UploadLargeFiles(ILocalFile, HandShake, Guid, int)

    Method use to uploads files to Secure Exchanges.This method is optimsed for large files.

    Declaration
    public List<UploadFiles> UploadLargeFiles(ILocalFile args, HandShake handShake, Guid rep, int maxDegreeOfParallelism = 6)
    Parameters
    Type Name Description
    ILocalFile args
    HandShake handShake
    Guid rep
    int maxDegreeOfParallelism

    The number of thread use to upload documents

    Returns
    Type Description
    List<UploadFiles>

    Events

    Before_UploadChunksErrorRetry

    Event fired before the retry of the upload chunks in errors.

    Declaration
    public event FileHelper.BeforeUploadChunksErrorRetry Before_UploadChunksErrorRetry
    Event Type
    Type Description
    FileHelper.BeforeUploadChunksErrorRetry

    DowloadChuckFinish_Event

    Fired when a chuck is finish donwload

    Declaration
    public event FileHelper.DownloadChuckFinishEvent DowloadChuckFinish_Event
    Event Type
    Type Description
    FileHelper.DownloadChuckFinishEvent

    DownloadChuckStart_Event

    Fired when a chuck is start donwload

    Declaration
    public event FileHelper.DownloadChuckStart DownloadChuckStart_Event
    Event Type
    Type Description
    FileHelper.DownloadChuckStart

    DownloadChunkErorr_Event

    Declaration
    public event FileHelper.DownloadChunkError DownloadChunkErorr_Event
    Event Type
    Type Description
    FileHelper.DownloadChunkError

    DownloadFileError_event

    The Event of the download file

    Declaration
    public event FileHelper.DownloadFileError DownloadFileError_event
    Event Type
    Type Description
    FileHelper.DownloadFileError

    DownloadFinish_event

    Fired when a file finish download

    Declaration
    public event FileHelper.DownloadFinish DownloadFinish_event
    Event Type
    Type Description
    FileHelper.DownloadFinish

    DownloadStart_event

    Fired when a file start download

    Declaration
    public event FileHelper.DownloadStart DownloadStart_event
    Event Type
    Type Description
    FileHelper.DownloadStart

    DownloadsFinish_event

    Fired after all download completed

    Declaration
    public event FileHelper.DownloadsFinish DownloadsFinish_event
    Event Type
    Type Description
    FileHelper.DownloadsFinish

    DownloadsStart_event

    Fired Before all download started

    Declaration
    public event FileHelper.DownloadsStart DownloadsStart_event
    Event Type
    Type Description
    FileHelper.DownloadsStart

    GetFileSizeBeforeUpload

    Fired when Secure Exchanges need to know the file size of all files before upload begin

    Declaration
    public static event FileHelper.GetFileSizeToUpload GetFileSizeBeforeUpload
    Event Type
    Type Description
    FileHelper.GetFileSizeToUpload

    UploadChunkCompleted_Event

    The event that need to be register to get and UploadChunkCompleted delegate

    Declaration
    public event FileHelper.UploadChunkCompleted UploadChunkCompleted_Event
    Event Type
    Type Description
    FileHelper.UploadChunkCompleted

    UploadChunkError_Event

    The event that must be instanciated to received the error chunk event.

    Declaration
    public event FileHelper.UploadChunkError UploadChunkError_Event
    Event Type
    Type Description
    FileHelper.UploadChunkError

    UploadEvent

    The event call when a chuck finish upload

    Declaration
    public static event FileHelper.UploadProgress UploadEvent
    Event Type
    Type Description
    FileHelper.UploadProgress

    UploadFileEnd_Event

    This event occur when all the file chunks has finish

    Declaration
    public event FileHelper.UploadFileDelegate UploadFileEnd_Event
    Event Type
    Type Description
    FileHelper.UploadFileDelegate

    UploadFileStart_Event

    This event occur before the file start to be uploaded to the server

    Declaration
    public event FileHelper.UploadFileDelegate UploadFileStart_Event
    Event Type
    Type Description
    FileHelper.UploadFileDelegate

    UploadFinishFiles_Event

    Declaration
    public event FileHelper.UploadFinishFiles UploadFinishFiles_Event
    Event Type
    Type Description
    FileHelper.UploadFinishFiles

    UploadFinish_Event

    Declaration
    public event FileHelper.UploadFinish UploadFinish_Event
    Event Type
    Type Description
    FileHelper.UploadFinish

    Extension Methods

    ExtensionHelper.CopySameNameAndTypeProperties<T, S>(T, S)
    In this article
    Back to top Secure Exchanges Inc. - Documentation