Discuss this help topic in SecureBlackbox Forum

TElSimpleSFTPClient.UploadFile

TElSimpleSFTPClient     See also     


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


Uploads the file.

Declaration

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

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

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

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

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

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

Parameters

  • LocalFileName - name of the file to be uploaded
  • RemoteFileName - remote name of the uploaded 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 upload a file to remote system. The method uses PipelineLength and UploadBlockSize to calculate the size of the chunks, which are sent to 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     DownloadFile     UploadStream     ASCIIMode     FileSystemAdapter     PipelineLength     UploadBlockSize     UseTruncateFlagOnUpload    

Discuss this help topic in SecureBlackbox Forum