Summary
Uploads the specified byte array via a HTTP POST to the specified uri using multipart/form-data.
Syntax
[CakeMethodAlias]
[CakeAliasCategory("Upload")]
public static void UploadFile(this ICakeContext context, Uri address, byte[] data, string fileName, UploadFileSettings settings)
Examples
var address = new Uri("http://www.example.org/upload");
UploadFile(address, @"path/to/file.txt", new UploadFileSettings() {
Username = "bob",
Password = "builder"
});
Attributes
Parameters
Name |
Type |
Description |
context |
ICakeContext |
The context. |
address |
Uri |
The URL of the upload resource. |
data |
byte[] |
The data to upload. |
fileName |
string |
The filename to give the uploaded data. |
settings |
UploadFileSettings |
The settings. |
Return Value