HttpAliases.

UploadFile(ICakeContext, Uri, FilePath, UploadFileSettings) Method

Summary

Uploads the specified file via a HTTP POST to the specified uri using multipart/form-data.
Namespace
Cake.Common.Net
Containing Type
HttpAliases

Syntax

[CakeMethodAlias]
[CakeAliasCategory("Upload")]
public static void UploadFile(this ICakeContext context, Uri address, FilePath filePath, 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

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.
CakeAliasCategoryAttribute An attribute used for documentation of alias methods/properties.

Parameters

Name Type Description
context ICakeContext The context.
address Uri The URL of the upload resource.
filePath FilePath The file to upload.
settings UploadFileSettings The settings.

Return Value

Type Description
void