---
product: Chilkat
product_version: 11.7.0
language: sqlserver
language_label: SQL Server
class: Upload
license: free
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/sqlserver_UploadRef.html
---
# Chilkat Upload — SQL Server — v11.7.0

> Chilkat 11.7.0 · language=sqlserver · class=Upload
> Other versions: replace `11.7.0` in this URL. Other languages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/<lang>/classes/Upload.md`.
> Language-wide rules (install, unlock, error model, strings/bytes): `https://www.chilkatsoft.com/ai-docs/v/11.7.0/sqlserver/guide.md`.

## Purpose

**Upload files with HTTP POST, form fields, headers, progress tracking, and TLS control.**

`Chilkat.Upload` sends files to a web server using HTTP POST, typically as a multipart/form-data upload. It supports one or more file references, custom form parameters, custom HTTP headers, blocking and asynchronous uploads, progress monitoring, upload throttling, Basic HTTP authentication, proxy settings, HTTPS/TLS configuration, timeout control, and inspection of the HTTP response returned by the server.

**File upload requests**

Add one or more local file references and send them to a server endpoint using HTTP POST.

**Form parameters**

Add ordinary form fields alongside file parts when the server expects metadata, tokens, IDs, or other POST parameters.

**Custom headers**

Include application-specific HTTP headers for authorization schemes, API requirements, content negotiation, or server-side routing.

**Blocking or async upload**

Use a simple blocking upload, begin an upload in the background, or use async task-based workflows where supported.

**Progress and throttling**

Monitor bytes sent, percent uploaded, current filename, upload state, and optionally throttle upload bandwidth.

**Authentication, proxy, and TLS**

Configure Basic authentication, HTTP/SOCKS proxy settings, HTTPS/TLS behavior, cipher restrictions, protocol versions, and certificate pinning.

**Common pattern:** Set the server `Hostname`, `Port`, `Ssl`, and upload `Path`, add file references with `AddFileReference`, add any form parameters or headers, then call `BlockingUpload` or start an asynchronous upload. After completion, inspect `ResponseStatus`, `ResponseHeader`, `ResponseBody`, and `LastErrorText` to determine what the server returned.

For an extended overview, see [Upload Class Overview](https://www.chilkatsoft.com/upload_class_overview.asp).

## Object creation, unlocking and error handling

**Object Creation**

```sql
DECLARE @hr int
DECLARE @upload int
EXEC @hr = sp_OACreate 'Chilkat.Upload', @upload OUT
IF @hr <> 0
BEGIN
    PRINT 'Failed to create ActiveX component'
    RETURN
END

-- ... use @upload ...

EXEC @hr = sp_OADestroy @upload
```

T-SQL uses the Chilkat ActiveX through the OLE Automation stored procedures. They must be enabled once on the server (`EXEC sp_configure 'Ole Automation Procedures', 1; RECONFIGURE;`), and the Chilkat ActiveX registered must match the bitness of the SQL Server instance (64-bit for a 64-bit SQL Server). To bind to a specific major version of Chilkat, append the major version number to the ProgID, such as `sp_OACreate 'Chilkat.Upload.11'` for Chilkat v11.\*.\*.

`sp_OACreate` returns an object token (an `int`) that is passed as the first argument of every `sp_OAMethod`, `sp_OAGetProperty` and `sp_OASetProperty` call, and released with `sp_OADestroy`. Objects returned by methods (such as an `HttpResponse` or `JsonObject`) are also tokens received through an `int` OUT parameter; they must likewise be destroyed, and the OUT parameter is `NULL` when the method fails to return an object. Objects passed as arguments are passed by their token. When an OLE Automation procedure itself fails (non-zero `@hr`), `sp_OAGetErrorInfo` describes the error.

Data types: strings are `nvarchar(4000)`; integers, booleans (1 or 0) and object tokens are `int`; dates are `datetime`. In the signatures on this page, `@success`, `@iResult`, `@sResult` and the like are the OUT variables receiving a method's return value, `@iValue` / `@sValue` receive or supply a property value, and the remaining `@` variables are the method's arguments in order.

A string returned through an OUT parameter is limited to 4000 characters. For longer values, retrieve the result as a result set into a table variable instead of an OUT parameter, for example `DECLARE @tmp TABLE (outputLine ntext)` followed by `INSERT INTO @tmp EXEC sp_OAGetProperty @upload, 'LastErrorText'`. See [string length limitations for strings returned by sp_OAMethod calls](https://www.chilkatsoft.com/sql_server_nvarchar_max_limitation.asp).

Methods that pass or return raw byte arrays are not shown on this page, because `varbinary(max)` values cannot be exchanged through `sp_OAMethod` (see [varbinary(max) limitation](https://www.chilkatsoft.com/sql_server_varbinary_max_limitation.asp)). Use the `BinData`-based alternatives (methods ending in *Bd*) or the base64 / hex string-encoded variants instead. Binary *properties* (such as `LastBinaryResult`) can be retrieved as a result set into a table variable, as shown in their signatures. Asynchronous (*\*Async*) methods and event callbacks are not available from SQL Server.

Call `Global.UnlockBundle` once at the start of the program, before using this or any other Chilkat class. Any string unlocks a fully functional 30-day trial; a purchased unlock code is used in production. See `guide.md` for the exact code in SQL Server.

How failure is reported depends on the method's return type and is stated in the note under each method below. In every case the diagnostic text is in the `LastErrorText` property of the object whose method was called.

## Members common to every Chilkat class

Documented once per language in `common-members.md`; listed here so this page is self-contained.

| Property | Signature | Access | Meaning |
|---|---|---|---|
| `DebugLogFilePath` | `EXEC sp_OAGetProperty @upload, 'DebugLogFilePath', @sValue OUT EXEC sp_OASetProperty @upload, 'DebugLogFilePath', @sValue` | read/write | If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. |
| `LastBinaryResult` | `INSERT INTO @tmp EXEC sp_OAGetProperty @upload, 'LastBinaryResult'` | read-only | This property is mainly used in SQL Server stored procedures to retrieve binary data from the last method call that returned binary data. |
| `LastErrorHtml` | `EXEC sp_OAGetProperty @upload, 'LastErrorHtml', @sValue OUT` | read-only | Provides HTML-formatted information about the last called method or property. |
| `LastErrorText` | `EXEC sp_OAGetProperty @upload, 'LastErrorText', @sValue OUT` | read-only | Provides plain text information about the last called method or property. |
| `LastErrorXml` | `EXEC sp_OAGetProperty @upload, 'LastErrorXml', @sValue OUT` | read-only | Provides XML-formatted information about the last called method or property. |
| `LastMethodSuccess` | `EXEC sp_OAGetProperty @upload, 'LastMethodSuccess', @iValue OUT EXEC sp_OASetProperty @upload, 'LastMethodSuccess', @iValue` | read/write | Indicates the success or failure of the most recent method call: `1` means success, `0` means failure. |
| `LastStringResult` | `EXEC sp_OAGetProperty @upload, 'LastStringResult', @sValue OUT` | read-only | In SQL Server stored procedures, this property holds the string return value of the most recent method call that returns a string. |
| `LastStringResultLen` | `EXEC sp_OAGetProperty @upload, 'LastStringResultLen', @iValue OUT` | read-only | The length, in characters, of the string contained in the LastStringResult property. |
| `VerboseLogging` | `EXEC sp_OAGetProperty @upload, 'VerboseLogging', @iValue OUT EXEC sp_OASetProperty @upload, 'VerboseLogging', @iValue` | read/write | If set to `1`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. |
| `Version` | `EXEC sp_OAGetProperty @upload, 'Version', @sValue OUT` | read-only | Version of the component/library, such as "10.1.0" |

## Member index

| Member | Kind | Signature |
|---|---|---|
| `AbortCurrent` | property, read/write | `EXEC sp_OAGetProperty @upload, 'AbortCurrent', @iValue OUT EXEC sp_OASetProperty @upload, 'AbortCurrent', @iValue` |
| `BandwidthThrottleUp` | property, read/write | `EXEC sp_OAGetProperty @upload, 'BandwidthThrottleUp', @iValue OUT EXEC sp_OASetProperty @upload, 'BandwidthThrottleUp', @iValue` |
| `ChunkSize` | property, read/write | `EXEC sp_OAGetProperty @upload, 'ChunkSize', @iValue OUT EXEC sp_OASetProperty @upload, 'ChunkSize', @iValue` |
| `ClientIpAddress` | property, read/write | `EXEC sp_OAGetProperty @upload, 'ClientIpAddress', @sValue OUT EXEC sp_OASetProperty @upload, 'ClientIpAddress', @sValue` |
| `CurrentFilename` | property, read-only | `EXEC sp_OAGetProperty @upload, 'CurrentFilename', @sValue OUT` |
| `Expect100Continue` | property, read/write | `EXEC sp_OAGetProperty @upload, 'Expect100Continue', @iValue OUT EXEC sp_OASetProperty @upload, 'Expect100Continue', @iValue` |
| `Hostname` | property, read/write | `EXEC sp_OAGetProperty @upload, 'Hostname', @sValue OUT EXEC sp_OASetProperty @upload, 'Hostname', @sValue` |
| `IdleTimeoutMs` | property, read/write | `EXEC sp_OAGetProperty @upload, 'IdleTimeoutMs', @iValue OUT EXEC sp_OASetProperty @upload, 'IdleTimeoutMs', @iValue` |
| `Login` | property, read/write | `EXEC sp_OAGetProperty @upload, 'Login', @sValue OUT EXEC sp_OASetProperty @upload, 'Login', @sValue` |
| `NumBytesSent` | property, read-only | `EXEC sp_OAGetProperty @upload, 'NumBytesSent', @iValue OUT` |
| `Password` | property, read/write | `EXEC sp_OAGetProperty @upload, 'Password', @sValue OUT EXEC sp_OASetProperty @upload, 'Password', @sValue` |
| `Path` | property, read/write | `EXEC sp_OAGetProperty @upload, 'Path', @sValue OUT EXEC sp_OASetProperty @upload, 'Path', @sValue` |
| `PercentUploaded` | property, read-only | `EXEC sp_OAGetProperty @upload, 'PercentUploaded', @iValue OUT` |
| `Port` | property, read/write | `EXEC sp_OAGetProperty @upload, 'Port', @iValue OUT EXEC sp_OASetProperty @upload, 'Port', @iValue` |
| `PreferIpv6` | property, read/write | `EXEC sp_OAGetProperty @upload, 'PreferIpv6', @iValue OUT EXEC sp_OASetProperty @upload, 'PreferIpv6', @iValue` |
| `ProxyDomain` | property, read/write | `EXEC sp_OAGetProperty @upload, 'ProxyDomain', @sValue OUT EXEC sp_OASetProperty @upload, 'ProxyDomain', @sValue` |
| `ProxyLogin` | property, read/write | `EXEC sp_OAGetProperty @upload, 'ProxyLogin', @sValue OUT EXEC sp_OASetProperty @upload, 'ProxyLogin', @sValue` |
| `ProxyPassword` | property, read/write | `EXEC sp_OAGetProperty @upload, 'ProxyPassword', @sValue OUT EXEC sp_OASetProperty @upload, 'ProxyPassword', @sValue` |
| `ProxyPort` | property, read/write | `EXEC sp_OAGetProperty @upload, 'ProxyPort', @iValue OUT EXEC sp_OASetProperty @upload, 'ProxyPort', @iValue` |
| `ResponseBody` | property, read-only | `INSERT INTO @tmp EXEC sp_OAGetProperty @upload, 'ResponseBody'` |
| `ResponseBodyStr` | property, read-only | `EXEC sp_OAGetProperty @upload, 'ResponseBodyStr', @sValue OUT` |
| `ResponseHeader` | property, read-only | `EXEC sp_OAGetProperty @upload, 'ResponseHeader', @sValue OUT` |
| `ResponseStatus` | property, read-only | `EXEC sp_OAGetProperty @upload, 'ResponseStatus', @iValue OUT` |
| `Ssl` | property, read/write | `EXEC sp_OAGetProperty @upload, 'Ssl', @iValue OUT EXEC sp_OASetProperty @upload, 'Ssl', @iValue` |
| `SslAllowedCiphers` | property, read/write | `EXEC sp_OAGetProperty @upload, 'SslAllowedCiphers', @sValue OUT EXEC sp_OASetProperty @upload, 'SslAllowedCiphers', @sValue` |
| `SslProtocol` | property, read/write | `EXEC sp_OAGetProperty @upload, 'SslProtocol', @sValue OUT EXEC sp_OASetProperty @upload, 'SslProtocol', @sValue` |
| `TlsPinSet` | property, read/write | `EXEC sp_OAGetProperty @upload, 'TlsPinSet', @sValue OUT EXEC sp_OASetProperty @upload, 'TlsPinSet', @sValue` |
| `TotalUploadSize` | property, read-only | `EXEC sp_OAGetProperty @upload, 'TotalUploadSize', @iValue OUT` |
| `UploadInProgress` | property, read-only | `EXEC sp_OAGetProperty @upload, 'UploadInProgress', @iValue OUT` |
| `UploadSuccess` | property, read-only | `EXEC sp_OAGetProperty @upload, 'UploadSuccess', @iValue OUT` |
| `AbortUpload` | method | `EXEC sp_OAMethod @upload, 'AbortUpload', NULL` |
| `AddCustomHeader` | method | `EXEC sp_OAMethod @upload, 'AddCustomHeader', NULL, @name, @value` |
| `AddFileReference` | method | `EXEC sp_OAMethod @upload, 'AddFileReference', NULL, @name, @filename` |
| `AddParam` | method | `EXEC sp_OAMethod @upload, 'AddParam', NULL, @name, @value` |
| `BeginUpload` | method | `EXEC sp_OAMethod @upload, 'BeginUpload', @success OUT` |
| `BlockingUpload` | method | `EXEC sp_OAMethod @upload, 'BlockingUpload', @success OUT` |
| `ClearFileReferences` | method | `EXEC sp_OAMethod @upload, 'ClearFileReferences', NULL` |
| `ClearParams` | method | `EXEC sp_OAMethod @upload, 'ClearParams', NULL` |
| `SleepMs` | method | `EXEC sp_OAMethod @upload, 'SleepMs', NULL, @millisec` |

## Properties

### Upload.AbortCurrent

`Chilkat 11.7.0 · sqlserver · Upload · AbortCurrent · property · read/write · since 9.5.0.58`

```sql
EXEC sp_OAGetProperty @upload, 'AbortCurrent', @iValue OUT
EXEC sp_OASetProperty @upload, 'AbortCurrent', @iValue
```

When set to `1`, causes the currently running method to abort. Methods that always finish quickly (i.e.have no length file operations or network communications) are not affected. If no method is running, then this property is automatically reset to `0` when the next method is called. When the abort occurs, this property is reset to `0`. Both synchronous and asynchronous method calls can be aborted. (A synchronous method call could be aborted by setting this property from a separate thread.)

### Upload.BandwidthThrottleUp

`Chilkat 11.7.0 · sqlserver · Upload · BandwidthThrottleUp · property · read/write · since 9.5.0.49`

```sql
EXEC sp_OAGetProperty @upload, 'BandwidthThrottleUp', @iValue OUT
EXEC sp_OASetProperty @upload, 'BandwidthThrottleUp', @iValue
```

If non-zero, limits (throttles) the upload bandwidth to approximately this maximum number of bytes per second. The default value of this property is 0.

### Upload.ChunkSize

`Chilkat 11.7.0 · sqlserver · Upload · ChunkSize · property · read/write`

```sql
EXEC sp_OAGetProperty @upload, 'ChunkSize', @iValue OUT
EXEC sp_OASetProperty @upload, 'ChunkSize', @iValue
```

The chunk size (in bytes) used by the underlying TCP/IP sockets for uploading files. The default value is 65535.

### Upload.ClientIpAddress

`Chilkat 11.7.0 · sqlserver · Upload · ClientIpAddress · property · read/write · since 9.5.0.49`

```sql
EXEC sp_OAGetProperty @upload, 'ClientIpAddress', @sValue OUT
EXEC sp_OASetProperty @upload, 'ClientIpAddress', @sValue
```

The IP address to use for computers with multiple network interfaces or IP addresses. For computers with a single network interface (i.e. most computers), this property should not be set. For multihoming computers, the default IP address is automatically used if this property is not set.

The IP address is a string such as in dotted notation using numbers, not domain names, such as `165.164.55.124`.

### Upload.CurrentFilename

`Chilkat 11.7.0 · sqlserver · Upload · CurrentFilename · property · read-only · since 9.5.0.90`

```sql
EXEC sp_OAGetProperty @upload, 'CurrentFilename', @sValue OUT
```

The current filename being uploaded while an asynchronous upload is in progress.

### Upload.Expect100Continue

`Chilkat 11.7.0 · sqlserver · Upload · Expect100Continue · property · read/write`

```sql
EXEC sp_OAGetProperty @upload, 'Expect100Continue', @iValue OUT
EXEC sp_OASetProperty @upload, 'Expect100Continue', @iValue
```

When `1`, the request header will included an `Expect: 100-continue` header field. This indicates that the server should respond with an intermediate response of `100 Continue` or `417 Expectation Failed` response based on the information available in the request header. This helps avoid situations such as limits on upload sizes. It allows the server to reject the upload, and then the client can abort prior to uploading the data.

The default value of this property is `1`.

### Upload.Hostname

`Chilkat 11.7.0 · sqlserver · Upload · Hostname · property · read/write`

```sql
EXEC sp_OAGetProperty @upload, 'Hostname', @sValue OUT
EXEC sp_OASetProperty @upload, 'Hostname', @sValue
```

The hostname of the HTTP server that is the target of the upload. Do not include `http://` in the hostname. It can be a hostname, such as `www.chilkatsoft.com`, or an IP address, such as `168.144.70.227`.

### Upload.IdleTimeoutMs

`Chilkat 11.7.0 · sqlserver · Upload · IdleTimeoutMs · property · read/write`

```sql
EXEC sp_OAGetProperty @upload, 'IdleTimeoutMs', @iValue OUT
EXEC sp_OASetProperty @upload, 'IdleTimeoutMs', @iValue
```

A timeout in milliseconds. The default value is 30000. If the upload hangs (i.e. progress halts) for more than this time, the component will abort the upload. (It will timeout.)

### Upload.Login

`Chilkat 11.7.0 · sqlserver · Upload · Login · property · read/write`

```sql
EXEC sp_OAGetProperty @upload, 'Login', @sValue OUT
EXEC sp_OASetProperty @upload, 'Login', @sValue
```

The HTTP login for sites requiring authentication. Chilkat Upload supports Basic HTTP authentication.

### Upload.NumBytesSent

`Chilkat 11.7.0 · sqlserver · Upload · NumBytesSent · property · read-only`

```sql
EXEC sp_OAGetProperty @upload, 'NumBytesSent', @iValue OUT
```

After an upload has completed, this property contains the number of bytes sent. During asynchronous uploads, this property contains the current number of bytes sent while the upload is in progress.

### Upload.Password

`Chilkat 11.7.0 · sqlserver · Upload · Password · property · read/write`

```sql
EXEC sp_OAGetProperty @upload, 'Password', @sValue OUT
EXEC sp_OASetProperty @upload, 'Password', @sValue
```

The HTTP password for sites requiring authentication. Chilkat Upload supports Basic HTTP authentication.

### Upload.Path

`Chilkat 11.7.0 · sqlserver · Upload · Path · property · read/write`

```sql
EXEC sp_OAGetProperty @upload, 'Path', @sValue OUT
EXEC sp_OASetProperty @upload, 'Path', @sValue
```

The path part of the upload URL. Some examples:

desc> If the upload target (i.e. consumer) URL is: http://www.freeaspupload.net/freeaspupload/testUpload.asp, then

> Hostname = `www.freeaspupload.net` Path = `/freeaspupload/testUpload.asp`

If the upload target URL is https://www.chilkatsoft.com/cgi-bin/ConsumeUpload.exe, then

> Hostname = `www.chilkatsoft.com` Path = `/cgi-bin/ConsumeUpload.exe`

### Upload.PercentUploaded

`Chilkat 11.7.0 · sqlserver · Upload · PercentUploaded · property · read-only`

```sql
EXEC sp_OAGetProperty @upload, 'PercentUploaded', @iValue OUT
```

Contains the current percentage completion (0 to 100) while an asynchronous upload is in progress.

### Upload.Port

`Chilkat 11.7.0 · sqlserver · Upload · Port · property · read/write`

```sql
EXEC sp_OAGetProperty @upload, 'Port', @iValue OUT
EXEC sp_OASetProperty @upload, 'Port', @iValue
```

The port number of the upload target (i.e. consumer) URL. The default value is 80. If SSL is used, this should be set to 443 (typically).

### Upload.PreferIpv6

`Chilkat 11.7.0 · sqlserver · Upload · PreferIpv6 · property · read/write`

```sql
EXEC sp_OAGetProperty @upload, 'PreferIpv6', @iValue OUT
EXEC sp_OASetProperty @upload, 'PreferIpv6', @iValue
```

If `1`, then use IPv6 over IPv4 when both are supported for a particular domain. The default value of this property is `0`, which will choose IPv4 over IPv6.

### Upload.ProxyDomain

`Chilkat 11.7.0 · sqlserver · Upload · ProxyDomain · property · read/write`

```sql
EXEC sp_OAGetProperty @upload, 'ProxyDomain', @sValue OUT
EXEC sp_OASetProperty @upload, 'ProxyDomain', @sValue
```

The domain name of a proxy host if an HTTP proxy is used. Do not include the `http://`. The domain name may be a hostname, such as `www.chilkatsoft.com`, or an IP address, such as `168.144.70.227`.

### Upload.ProxyLogin

`Chilkat 11.7.0 · sqlserver · Upload · ProxyLogin · property · read/write`

```sql
EXEC sp_OAGetProperty @upload, 'ProxyLogin', @sValue OUT
EXEC sp_OASetProperty @upload, 'ProxyLogin', @sValue
```

If an HTTP proxy is used and it requires authentication, this property specifies the HTTP proxy login.

### Upload.ProxyPassword

`Chilkat 11.7.0 · sqlserver · Upload · ProxyPassword · property · read/write`

```sql
EXEC sp_OAGetProperty @upload, 'ProxyPassword', @sValue OUT
EXEC sp_OASetProperty @upload, 'ProxyPassword', @sValue
```

If an HTTP proxy is used and it requires authentication, this property specifies the HTTP proxy password.

### Upload.ProxyPort

`Chilkat 11.7.0 · sqlserver · Upload · ProxyPort · property · read/write`

```sql
EXEC sp_OAGetProperty @upload, 'ProxyPort', @iValue OUT
EXEC sp_OASetProperty @upload, 'ProxyPort', @iValue
```

The port number of a proxy server if an HTTP proxy is used.

### Upload.ResponseBody

`Chilkat 11.7.0 · sqlserver · Upload · ResponseBody · property · read-only`

```sql
INSERT INTO @tmp EXEC sp_OAGetProperty @upload, 'ResponseBody'
```

An HTTP upload is nothing more than an HTTP POST that contains the content of the files being uploaded. Just as with any HTTP POST or GET, the server should send an HTTP response that consists of header and body.

desc>This property contains the body part of the HTTP response.

### Upload.ResponseBodyStr

`Chilkat 11.7.0 · sqlserver · Upload · ResponseBodyStr · property · read-only · since 9.5.0.83`

```sql
EXEC sp_OAGetProperty @upload, 'ResponseBodyStr', @sValue OUT
```

Returns the response body as a string.

### Upload.ResponseHeader

`Chilkat 11.7.0 · sqlserver · Upload · ResponseHeader · property · read-only`

```sql
EXEC sp_OAGetProperty @upload, 'ResponseHeader', @sValue OUT
```

An HTTP upload is nothing more than an HTTP POST that contains the content of the files being uploaded. Just as with any HTTP POST or GET, the server should send an HTTP response that consists of header and body.

desc>This property contains the header part of the HTTP response.

### Upload.ResponseStatus

`Chilkat 11.7.0 · sqlserver · Upload · ResponseStatus · property · read-only`

```sql
EXEC sp_OAGetProperty @upload, 'ResponseStatus', @iValue OUT
```

The HTTP response status code of the HTTP response. A list of HTTP status codes can be found here: [HTTP Response Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes).

### Upload.Ssl

`Chilkat 11.7.0 · sqlserver · Upload · Ssl · property · read/write`

```sql
EXEC sp_OAGetProperty @upload, 'Ssl', @iValue OUT
EXEC sp_OASetProperty @upload, 'Ssl', @iValue
```

Set this to `1` if the upload is to HTTPS. For example, if the target of the upload is:

> **https://www.myuploadtarget.com/consumeUpload.asp**

desc>then set:

> Ssl = `1`  
> Hostname = `www.myuploadtarget.com`  
> Path = `/consumeupload.asp`  
> Port = 443

### Upload.SslAllowedCiphers

`Chilkat 11.7.0 · sqlserver · Upload · SslAllowedCiphers · property · read/write · since 9.5.0.55`

```sql
EXEC sp_OAGetProperty @upload, 'SslAllowedCiphers', @sValue OUT
EXEC sp_OASetProperty @upload, 'SslAllowedCiphers', @sValue
```

Provides a means for setting a list of ciphers that are allowed for SSL/TLS connections. The default (empty string) indicates that all implemented ciphers are possible. The TLS ciphers supported in Chilkat v9.5.0.55 and later are:

```
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
TLS_DHE_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_AES_256_CBC_SHA256
TLS_RSA_WITH_AES_256_GCM_SHA384
TLS_RSA_WITH_AES_256_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
TLS_DHE_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_128_CBC_SHA256
TLS_RSA_WITH_AES_128_GCM_SHA256
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
TLS_RSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDHE_RSA_WITH_RC4_128_SHA
TLS_RSA_WITH_RC4_128_SHA
TLS_RSA_WITH_RC4_128_MD5
TLS_DHE_RSA_WITH_DES_CBC_SHA
TLS_RSA_WITH_DES_CBC_SHA
```

To restrict SSL/TLS connections to one or more specific ciphers, set this property to a comma-separated list of ciphers such as `TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384`. The order should be in terms of preference, with the preferred algorithms listed first. (Note that the client cannot specifically choose the algorithm is picked because it is the server that chooses. The client simply provides the server with a list from which to choose.)

The property can also disallow connections with servers having certificates with RSA keys less than a certain size. By default, server certificates having RSA keys of 512 bits or greater are allowed. Add the keyword `rsa1024` to disallow connections with servers having keys smaller than 1024 bits. Add the keyword `rsa2048` to disallow connections with servers having keys smaller than 2048 bits.

**Note:** Prior to Chilkat v9.5.0.55, it was not possible to explicitly list allowed cipher suites. The deprecated means for indicating allowed ciphers was both incomplete and unprecise. For example, the following keywords could be listed to allow matching ciphers: `aes256-cbc`, `aes128-cbc`, `3des-cbc`, and `rc4`. These keywords will still be recognized, but programs should be updated to explicitly list the allowed ciphers.

**secure-renegotiation:** Starting in Chilkat v9.5.0.55, the keyword `secure-renegotiation` may be added to require that all renegotions be done securely (as per RFC 5746).

**best-practices:** Starting in Chilkat v9.5.0.55, this property may be set to the single keyword `best-practices`. This will allow ciphers based on the current best practices. As new versions of Chilkat are released, the best practices may change. Changes will be noted here. The current best practices are:

- If the server uses an RSA key, it must be 1024 bits or greater.
- All renegotations must be secure renegotiations.
- All ciphers using RC4, DES, or 3DES are disallowed.

**Example:** The following string would restrict to 2 specific cipher suites, require RSA keys to be 1024 bits or greater, and require secure renegotiations: `TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, rsa1024, secure-renegotiation`

### Upload.SslProtocol

`Chilkat 11.7.0 · sqlserver · Upload · SslProtocol · property · read/write · since 9.5.0.55`

```sql
EXEC sp_OAGetProperty @upload, 'SslProtocol', @sValue OUT
EXEC sp_OASetProperty @upload, 'SslProtocol', @sValue
```

Selects the secure protocol to be used for secure (SSL/TLS) connections. Possible values are:

> default  
> TLS 1.3  
> TLS 1.2  
> TLS 1.1  
> TLS 1.0  
> SSL 3.0  
> TLS 1.3 or higher  
> TLS 1.2 or higher  
> TLS 1.1 or higher  
> TLS 1.0 or higher

The default value is `default` which will choose the, which allows for the protocol to be selected dynamically at runtime based on the requirements of the server. Choosing an exact protocol will cause the connection to fail unless that exact protocol is negotiated. It is better to choose `X or higher` than an exact protocol. The `default` is effectively `SSL 3.0 or higher`.

### Upload.TlsPinSet

`Chilkat 11.7.0 · sqlserver · Upload · TlsPinSet · property · read/write · since 9.5.0.55`

```sql
EXEC sp_OAGetProperty @upload, 'TlsPinSet', @sValue OUT
EXEC sp_OASetProperty @upload, 'TlsPinSet', @sValue
```

**Full documentation for this property (same in every language):** [Encodings Supported by Chilkat](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/binary_encodings.md)

Specifies a set of pins for Public Key Pinning for TLS connections. This property lists the expected SPKI fingerprints for the server certificates. If the server's certificate (sent during the TLS handshake) does not match any of the SPKI fingerprints, then the TLS handshake is aborted and the connection fails. The format of this string property is as follows:

```
hash_algorithm, encoding, SPKI_fingerprint_1, SPKI_fingerprint_2, ...
```

For example, the following string specifies a single sha256 base64-encoded SPKI fingerprint:

```
"sha256, base64, lKg1SIqyhPSK19tlPbjl8s02yChsVTDklQpkMCHvsTE="
```

This example specifies two SPKI fingerprints:

```
"sha256, base64, 4t37LpnGmrMEAG8HEz9yIrnvJV2euVRwCLb9EH5WZyI=, 68b0G5iqMvWVWvUCjMuhLEyekM5729PadtnU5tdXZKs="
```

Any of the following hash algorithms are allowed:.sha1, sha256, sha384, sha512, md2, md5, haval, ripemd128, ripemd160,ripemd256, or ripemd320.

The following encodings are allowed: base64, hex, and any of the encodings indicated in the link below.

### Upload.TotalUploadSize

`Chilkat 11.7.0 · sqlserver · Upload · TotalUploadSize · property · read-only`

```sql
EXEC sp_OAGetProperty @upload, 'TotalUploadSize', @iValue OUT
```

The total size of the upload (in bytes). This property will become set at the beginning of an asynchronous upload. A program may monitor asynchronous uploads by tracking both NumBytesSent and PercentUploaded.

desc> This property is also set during synchronous uploads.

### Upload.UploadInProgress

`Chilkat 11.7.0 · sqlserver · Upload · UploadInProgress · property · read-only`

```sql
EXEC sp_OAGetProperty @upload, 'UploadInProgress', @iValue OUT
```

Set to `1` when an asynchronous upload is started. When the asynchronous upload is complete, this property becomes equal to `0`. A program will typically begin an asynchronous upload by calling BeginUpload, and then periodically checking the value of this property to determine when the upload is complete.

### Upload.UploadSuccess

`Chilkat 11.7.0 · sqlserver · Upload · UploadSuccess · property · read-only`

```sql
EXEC sp_OAGetProperty @upload, 'UploadSuccess', @iValue OUT
```

Set to `1` (success) or `0` (failed) after an asynchronous upload completes or aborts due to failure. When a program does an asynchronous upload, it will wait until UploadInProgress becomes `0`. It will then check the value of this property to determine if the upload was successful or not.

## Methods

### Upload.AbortUpload

`Chilkat 11.7.0 · sqlserver · Upload · AbortUpload · method`

```sql
EXEC sp_OAMethod @upload, 'AbortUpload', NULL
```

May be called during an asynchronous upload to abort.

### Upload.AddCustomHeader

`Chilkat 11.7.0 · sqlserver · Upload · AddCustomHeader · method`

```sql
EXEC sp_OAMethod @upload, 'AddCustomHeader', NULL, @name, @value
```

Adds a custom HTTP header to the HTTP upload.

### Upload.AddFileReference

`Chilkat 11.7.0 · sqlserver · Upload · AddFileReference · method`

```sql
EXEC sp_OAMethod @upload, 'AddFileReference', NULL, @name, @filename
```

Adds a file to the list of files to be uploaded in the next call to BlockingUpload, BeginUpload, or UploadToMemory. To upload more than one file, call this method once for each file to be uploaded.

### Upload.AddParam

`Chilkat 11.7.0 · sqlserver · Upload · AddParam · method`

```sql
EXEC sp_OAMethod @upload, 'AddParam', NULL, @name, @value
```

Adds a custom HTTP request parameter to the upload.

### Upload.BeginUpload

`Chilkat 11.7.0 · sqlserver · Upload · BeginUpload · method`

```sql
EXEC sp_OAMethod @upload, 'BeginUpload', @success OUT
```

Starts an asynchronous upload. Only one asynchronous upload may be in progress at a time. To achieve multiple asynchronous uploads, use multiple instances of the Chilkat Upload object. Each object instance is capable of managing a single asynchronous upload.

desc> When this method is called, a background thread is started and the asynchronous upload runs in the background. The upload may be aborted at any time by calling AbortUpload. The upload is completed (or failed) when UploadInProgress becomes `0`. At that point, the UploadSuccess property may be checked to determine success (`1`) or failure (`0`).

Returns 1 for success, 0 for failure.

See also:

- [Debugging HTTP Upload](http://www.cknotes.com/?p=138)

### Upload.BlockingUpload

`Chilkat 11.7.0 · sqlserver · Upload · BlockingUpload · method`

```sql
EXEC sp_OAMethod @upload, 'BlockingUpload', @success OUT
```

Uploads files to a web server using HTTP. The files to be uploaded are indicated by calling AddFileReference once for each file (prior to calling this method).

Returns 1 for success, 0 for failure.

See also:

- [Debugging HTTP Upload](http://www.cknotes.com/?p=138)
- [IIS 7.0 Upload Size Limitations](http://www.cknotes.com/?p=100)
- [IIS 6.0 Upload Size Limitations](http://www.cknotes.com/?p=136)

### Upload.ClearFileReferences

`Chilkat 11.7.0 · sqlserver · Upload · ClearFileReferences · method`

```sql
EXEC sp_OAMethod @upload, 'ClearFileReferences', NULL
```

Clears the internal list of files created by calls to AddFileReference.

### Upload.ClearParams

`Chilkat 11.7.0 · sqlserver · Upload · ClearParams · method`

```sql
EXEC sp_OAMethod @upload, 'ClearParams', NULL
```

Clears the internal list of params created by calls to AddParam.

### Upload.SleepMs

`Chilkat 11.7.0 · sqlserver · Upload · SleepMs · method`

```sql
EXEC sp_OAMethod @upload, 'SleepMs', NULL, @millisec
```

A convenience method for putting the calling process to sleep for N milliseconds. It is provided here because some programming languages do not provide this capability, and sleeping for short increments of time is helpful when doing asynchronous uploads.

## Events and callbacks

This binding has no event callbacks.

