Ftp.GetFileAsync Method
Namespace: Rebex.Net
Assembly: Rebex.Ftp.dll (version 7.0.9083)
GetFileAsync(String, Stream, Int64, Object)
Begins asynchronous GetFile operation. Downloads the remote file to the data stream.
Declaration
public Task<long> GetFileAsync(string remotePath, Stream outputStream, long remoteOffset, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | remotePath | The path of the remote file. |
Stream | outputStream | The output stream. |
Int64 | remoteOffset | The starting offset of the remote file. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Int64> | Number of bytes transferred. |
Implements
Remarks
Represents FTP RETR command.
The path parameter can specify either relative or absolute path. Relative path is interpreted as relative to the current working directory. Use GetCurrentDirectory to obtain the current working directory.
GetFileAsync(String, String, Int64, Int64, Object)
Begins asynchronous GetFile operation. Downloads the remote file to the local file.
Declaration
public Task<long> GetFileAsync(string remotePath, string localPath, long remoteOffset, long localOffset, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | remotePath | The path of the remote file. |
String | localPath | The path of the local file. This cannot be a directory. |
Int64 | remoteOffset | The starting offset of the remote file. |
Int64 | localOffset | The starting offset in the local file. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Int64> | Number of bytes transferred. |
Implements
Remarks
Represents FTP RETR command.
If the specified local file does not exist, it is created; if it does exist and the local offset is greater than 0, the contents after the offset are overwritten.
If the localOffset is less than or equal to zero and the file exists, it will be truncated to zero length before the transfer starts.
The path parameter can specify either relative or absolute path. Relative path is interpreted as relative to the current working directory. Use GetCurrentDirectory to obtain the current working directory.
GetFileAsync(String, Stream, Object)
Begins asynchronous GetFile operation. Downloads the remote file to the data stream.
Declaration
public Task<long> GetFileAsync(string remotePath, Stream outputStream, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | remotePath | The path of the remote file. |
Stream | outputStream | The output stream. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Int64> | Number of bytes transferred. |
Implements
Remarks
The path parameter can specify either relative or absolute path. Relative path is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory.
GetFileAsync(String, String, Object)
Begins asynchronous GetFile operation. Downloads the remote file to the local file.
Declaration
public Task<long> GetFileAsync(string remotePath, string localPath, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | remotePath | The path of the remote file. |
String | localPath | The path of the local file. This cannot be a directory. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<Int64> | Number of bytes transferred. |
Implements
Remarks
The path parameter can specify either relative or absolute path. Relative path is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory().
If the specified file does not exist, it is created; if it does exist, it is truncated and overwritten.