# SalFtpClient

Namespace: **PPJ.Runtime.Internet**

Assembly: **PPJ.Runtime.49** (4.9.0.0)

FTP implementation used to support SalQuickFtp.

{% tabs %}
{% tab title="C#" %}

```csharp
public class SalFtpClient : IDisposable
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class SalFtpClient
    Inherits IDisposable
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)SalFtpClient()

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)SalFtpClient(server, user, password)

| Name         | Type                                                                | Description |
| ------------ | ------------------------------------------------------------------- | ----------- |
| **server**   | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |
| **user**     | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |
| **password** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)SalFtpClient(server, user, password, port)

| Name         | Type                                                                | Description |
| ------------ | ------------------------------------------------------------------- | ----------- |
| **server**   | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |
| **user**     | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |
| **password** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |
| **port**     | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)   |             |

## Properties

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)BinaryMode

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns/Sets binary mode transfer.

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Connected

[Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean): Returns true if the connection to the server is established.

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Password

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): User password.

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Port

[Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32): Server port number. The default is 21.

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Server

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): Name of the FTP server.

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)User

[String](https://docs.microsoft.com/en-us/dotnet/api/system.string): User name.

## Methods

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)AsyncDownload(fileName, localFileName, resume)

Asynchronous download

| Parameter         | Type                                                                  | Description |
| ----------------- | --------------------------------------------------------------------- | ----------- |
| **fileName**      | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)   |             |
| **localFileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)   |             |
| **resume**        | [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)AsyncUpload(fileName, remoteFileName, resume)

Asynchronous upload

| Parameter          | Type                                                                  | Description |
| ------------------ | --------------------------------------------------------------------- | ----------- |
| **fileName**       | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)   |             |
| **remoteFileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)   |             |
| **resume**         | [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)ChangeDir(dir)

Change the current working directory on the remote FTP server.

| Parameter | Type                                                                | Description |
| --------- | ------------------------------------------------------------------- | ----------- |
| **dir**   | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Close()

Close the FTP connection.

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Connect()

Connect and login to the remote server.

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)ConnectDataReader()

Creates a new StreamReader bound to an incoming data socket.

**Returns:** [StreamReader](https://docs.microsoft.com/en-us/dotnet/api/system.io.streamreader).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)ConnectDataSocket()

Open a new data socket.

**Returns:** [Socket](https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.socket).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)DeleteFile(fileName)

Delete a file from the remote FTP server.

| Parameter    | Type                                                                | Description |
| ------------ | ------------------------------------------------------------------- | ----------- |
| **fileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Dispose()

Disposes the FTP client

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Download(fileName)

Download a file.

| Parameter    | Type                                                                | Description |
| ------------ | ------------------------------------------------------------------- | ----------- |
| **fileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Download(fileName, resume)

Download a file.

| Parameter    | Type                                                                  | Description |
| ------------ | --------------------------------------------------------------------- | ----------- |
| **fileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)   |             |
| **resume**   | [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Download(fileName, localFileName)

Download a file to a local file name.

| Parameter         | Type                                                                | Description |
| ----------------- | ------------------------------------------------------------------- | ----------- |
| **fileName**      | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |
| **localFileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Download(fileName, localFileName, resume)

Download a file to a local file name.

| Parameter         | Type                                                                  | Description |
| ----------------- | --------------------------------------------------------------------- | ----------- |
| **fileName**      | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)   |             |
| **localFileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)   |             |
| **resume**        | [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)GetCurDir()

Returns the current directory.

**Returns:** [String](https://docs.microsoft.com/en-us/dotnet/api/system.string).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)GetFileInfo(mask)

Returns a FileSystemInfo array.

| Parameter | Type                                                                | Description |
| --------- | ------------------------------------------------------------------- | ----------- |
| **mask**  | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

**Returns:** [FtpFileInfo\[\]](https://desktop-api.iceteagroup.com/ppj.runtime.49/internet/ppj.runtime.internet.salftpclient).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)GetFileList(mask)

Return a string array containing the remote directory's file list.

| Parameter | Type                                                                | Description |
| --------- | ------------------------------------------------------------------- | ----------- |
| **mask**  | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

**Returns:** [String\[\]](https://docs.microsoft.com/en-us/dotnet/api/system.string).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)GetFileSize(fileName)

Return the size of a file.

| Parameter    | Type                                                                | Description |
| ------------ | ------------------------------------------------------------------- | ----------- |
| **fileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

**Returns:** [Int64](https://docs.microsoft.com/en-us/dotnet/api/system.int64).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)MakeDir(dir)

Create a directory on the remote FTP server.

| Parameter | Type                                                                | Description |
| --------- | ------------------------------------------------------------------- | ----------- |
| **dir**   | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)ReadResponse()

Reads the next response code from the connected socket.

**Returns:** [FtpResponse](https://desktop-api.iceteagroup.com/ppj.runtime.49/internet/ppj.runtime.internet.salftpclient).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)RemoveDir(dir)

Delete a directory on the remote FTP server.

| Parameter | Type                                                                | Description |
| --------- | ------------------------------------------------------------------- | ----------- |
| **dir**   | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)RenameFile(oldFileName, newFileName)

Rename a file on the remote FTP server.

| Parameter       | Type                                                                | Description |
| --------------- | ------------------------------------------------------------------- | ----------- |
| **oldFileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |
| **newFileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)SendCommand(command, validCodes)

| Parameter      | Type                                                                  | Description |
| -------------- | --------------------------------------------------------------------- | ----------- |
| **command**    | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)   |             |
| **validCodes** | [Int32\[\]](https://docs.microsoft.com/en-us/dotnet/api/system.int32) |             |

**Returns:** [FtpResponse](https://desktop-api.iceteagroup.com/ppj.runtime.49/internet/ppj.runtime.internet.salftpclient).

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Upload(fileName)

Upload a file.

| Parameter    | Type                                                                | Description |
| ------------ | ------------------------------------------------------------------- | ----------- |
| **fileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Upload(fileName, resume)

Upload a file.

| Parameter    | Type                                                                  | Description |
| ------------ | --------------------------------------------------------------------- | ----------- |
| **fileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)   |             |
| **resume**   | [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Upload(fileName, remoteFileName)

Upload a file.

| Parameter          | Type                                                                | Description |
| ------------------ | ------------------------------------------------------------------- | ----------- |
| **fileName**       | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |
| **remoteFileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string) |             |

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)Upload(fileName, remoteFileName, resume)

Upload a file.

| Parameter          | Type                                                                  | Description |
| ------------------ | --------------------------------------------------------------------- | ----------- |
| **fileName**       | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)   |             |
| **remoteFileName** | [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)   |             |
| **resume**         | [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean) |             |

## Events

### ![](https://299326270-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7qefdGDqaAibSgFIaGI0%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)StatusUpdate

[FtpEventHandler](https://desktop-api.iceteagroup.com/ppj.runtime.49/internet/ppj.runtime.internet.salftpclient) Status event
