Discuss this help topic in SecureBlackbox Forum

TElSimpleSFTPClient.DownloadFile

TElSimpleSFTPClient     See also     


Filter: C#  VB.NET  Pascal  C++  PHP  Java  


Downloads file.

Declaration

[C#]
    void DownloadFile(string RemoteFileName, string LocalFileName);
    void DownloadFile(string RemoteFileName, string LocalFileName, bool SuppressAdditionalOperations);
    void DownloadFile(string RemoteFileName, string LocalFileName, TSBFileTransferMode Mode);
    void DownloadFile(string RemoteFileName, string LocalFileName, TSBFileTransferMode Mode, long RestartFrom);

[VB.NET]
    Sub DownloadFile(ByVal RemoteFileName As String, ByVal LocalFileName As String)
    Sub DownloadFile(ByVal RemoteFileName As String, ByVal LocalFileName As String, ByVal SuppressAdditionalOperations As Boolean)
    Sub DownloadFile(ByVal RemoteFileName As String, ByVal LocalFileName As String, ByVal Mode As TSBFileTransferMode)
    Sub DownloadFile(ByVal RemoteFileName As String, ByVal LocalFileName As String, ByVal Mode As TSBFileTransferMode, ByVal RestartFrom As Long)

[Pascal]
    procedure DownloadFile(const RemoteFileName, LocalFileName : string); overload;
    procedure DownloadFile(const RemoteFileName, LocalFileName : string; SuppressAdditionalOperations : boolean); overload;
    procedure DownloadFile(const RemoteFileName, LocalFileName : string; Mode : TSBFileTransferMode); overload;
    procedure DownloadFile(const RemoteFileName, LocalFileName : string; Mode : TSBFileTransferMode; RestartFrom : Int64); overload;

[C++]
    void DownloadFile(const std::string &RemoteFileName, const std::string &LocalFileName);
    void DownloadFile(const std::string &RemoteFileName, const std::string &LocalFileName, bool SuppressAdditionalOperations);
    void DownloadFile(const std::string &RemoteFileName, const std::string &LocalFileName, TSBFileTransferMode Mode);
    void DownloadFile(const std::string &RemoteFileName, const std::string &LocalFileName, TSBFileTransferMode Mode, int64_t RestartFrom);

[PHP]
    void DownloadFile(string $RemoteFileName, string $LocalFileName)
    void DownloadFile(string $RemoteFileName, string $LocalFileName, bool $SuppressAdditionalOperations)
    void DownloadFile(string $RemoteFileName, string $LocalFileName, integer $Mode)
    void DownloadFile(string $RemoteFileName, string $LocalFileName, integer $Mode, integer $RestartFrom)

[Java]
    void downloadFile(String RemoteFileName, String LocalFileName, TSBFileTransferMode Mode, long RestartFrom);
    void downloadFile(String RemoteFileName, String LocalFileName, boolean SuppressAdditionalOperations);
    void downloadFile(String RemoteFileName, String LocalFileName);
    void downloadFile(String RemoteFileName, String LocalFileName, TSBFileTransferMode Mode);

Parameters

  • RemoteFileName - the name of the file to be downloaded
  • LocalFileName - local name for the downloaded file
  • Mode - specifies what to do if the file with the same name already exists
  • RestartFrom - can be used to resume broken transfer operation.When RestartFrom is set to non-zero positive value, the file being transferred is read starting from RestartFrom position and is written also starting from RestartFrom position.
  • SuppressAdditionalOperations - allows to overcome problems with some buggy SFTP servers by suppressing additional file operations.

Values

Description

    Use this method when you want to download a file. The method uses PipelineLength and DownloadBlockSize to calculate the size of the chunks, which are requested from the server. To select ASCII or binary transfer mode use ASCIIMode property.
    In case of error, EElSFTPError exception containing SFTP error code, is raised. For more information on error handling, please read the corresponding how-to article.

See also:     About file system adapters     DownloadStream     UploadFile     ASCIIMode     DownloadBlockSize     FileSystemAdapter     PipelineLength    

Discuss this help topic in SecureBlackbox Forum