# 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

### ![](/files/dBIrS7XBDGmrzmTRbSI6)SalFtpClient()

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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) |             |

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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

### ![](/files/dBIrS7XBDGmrzmTRbSI6)BinaryMode

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

### ![](/files/dBIrS7XBDGmrzmTRbSI6)Connected

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

### ![](/files/dBIrS7XBDGmrzmTRbSI6)Password

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

### ![](/files/dBIrS7XBDGmrzmTRbSI6)Port

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

### ![](/files/dBIrS7XBDGmrzmTRbSI6)Server

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

### ![](/files/dBIrS7XBDGmrzmTRbSI6)User

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

## Methods

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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) |             |

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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) |             |

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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) |             |

### ![](/files/dBIrS7XBDGmrzmTRbSI6)Close()

Close the FTP connection.

### ![](/files/dBIrS7XBDGmrzmTRbSI6)Connect()

Connect and login to the remote server.

### ![](/files/dBIrS7XBDGmrzmTRbSI6)ConnectDataReader()

Creates a new StreamReader bound to an incoming data socket.

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

### ![](/files/dBIrS7XBDGmrzmTRbSI6)ConnectDataSocket()

Open a new data socket.

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

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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) |             |

### ![](/files/dBIrS7XBDGmrzmTRbSI6)Dispose()

Disposes the FTP client

### ![](/files/dBIrS7XBDGmrzmTRbSI6)Download(fileName)

Download a file.

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

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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) |             |

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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) |             |

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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) |             |

### ![](/files/dBIrS7XBDGmrzmTRbSI6)GetCurDir()

Returns the current directory.

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

### ![](/files/dBIrS7XBDGmrzmTRbSI6)GetFileInfo(mask)

Returns a FileSystemInfo array.

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

**Returns:** [FtpFileInfo\[\]](/ppj.runtime.49/internet/ppj.runtime.internet.salftpclient.md).

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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).

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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).

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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) |             |

### ![](/files/dBIrS7XBDGmrzmTRbSI6)ReadResponse()

Reads the next response code from the connected socket.

**Returns:** [FtpResponse](/ppj.runtime.49/internet/ppj.runtime.internet.salftpclient.md).

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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) |             |

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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) |             |

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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](/ppj.runtime.49/internet/ppj.runtime.internet.salftpclient.md).

### ![](/files/dBIrS7XBDGmrzmTRbSI6)Upload(fileName)

Upload a file.

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

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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) |             |

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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) |             |

### ![](/files/dBIrS7XBDGmrzmTRbSI6)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

### ![](/files/dBIrS7XBDGmrzmTRbSI6)StatusUpdate

[FtpEventHandler](/ppj.runtime.49/internet/ppj.runtime.internet.salftpclient.md) Status event


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://desktop-api.iceteagroup.com/ppj.runtime.49/internet/ppj.runtime.internet.salftpclient.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
