FtpAliases.

FtpUploadFile(ICakeContext, Uri, FilePath, FtpSettings) Method

Summary

Uploads the file to the FTP server using the supplied credentials.
Assembly
Cake.Ftp.dll
Namespace
Cake.Ftp
Containing Type
FtpAliases

Syntax

public static void FtpUploadFile(this ICakeContext context, Uri serverUri, FilePath fileToUpload, FtpSettings settings)

Examples

Task("UploadFile")
  .Does(() => {
    var fileToUpload = File("some.txt");
    var settings = new FtpSettings() {Username = "some-user", Password = "some-password"};
    FtpUploadFile("ftp://myserver/random/test.htm", fileToUpload, settings);
});

Attributes

Type Description
CakeMethodAliasAttribute

Parameters

Name Type Description
context ICakeContext The context.
serverUri Uri FTP URI requring FTP:// scehma.
fileToUpload FilePath The file to be uploaded.
settings FtpSettings The settings.

Return Value

Type Description
void