Declaration
public void AddFile(
string name,
string filename,
byte[] data,
string contentType = "application/octet-stream"
)
Summary
Adds a named file (or, generally, a binary data field) to the POST request.
Parameters
string | name |
The name of the value to add. For maximum compatibility with servers, use only printable ASCII characters in this
name. This field is encoded using UTF-8, which is supported by some modern servers, but not by others. |
string | filename |
The filename to use. The server may interpret this as it pleases, but this value will often end up being exposed
as the name of the uploaded file. For maximum compatibility with servers, use only printable ASCII characters in
this name. This field is encoded using UTF-8, which is supported by some modern servers, but not by
others. |
byte[] | data |
The binary data to send as the content of this file. |
string | contentType |
The content type to specify for this data/file. Some servers decide whether to accept or reject an upload based on
the content type. Specify null to prevent the inclusion of the Content-Type header. |