This method uploads a file to an FTP server with specifying the host name, the remote URI, the port number, and the local filename.

[Visual Basic] Public Function FtpUploadFile(ByVal remoteHost As String, ByVal remotePath As String, ByVal remotePort As Integer, ByVal localFileName As String) As Boolean
[C#] public bool FtpUploadFile(string remoteHost, string remotePath, int remotePort, string localFileName);

Parameters

remoteHost
   Domain name in DNS style, or IP address

remotePath
   The name of the remote path

remotePort
   IP port number

localFileName
   Local file name 

Return Value

Returns True if successful. Returns False if unsuccessful.

Explanation

The FtpUploadFile method uploads a file to an FTP server with specifying the host name, the remote URI, the port number, and the local filename.

This method is effective for the FTP protocol.

Example

[Visual Basic.NET]
Dim Ret As Boolean
'Username and password
ImageKit.File.FtpCredentials = New NetworkCredential("user", "password")
'Enables passive mode connectivity
ImageKit.File.FtpPassive = True
'Uploads the file
Ret = ImageKit.File.FtpUploadFile("www.newtone.co.jp", "test/test.jpg", 21, "c:\test\test.jpg")

[Visual C#.NET]
bool Ret;
//Username and password
ImageKit.File.FtpCredentials = new NetworkCredential("user", "password");
//Enables passive mode connectivity
ImageKit.File.FtpPassive = true;
//Uploads the file
Ret = ImageKit.File.FtpUploadFile("www.newtone.co.jp", "test/test.jpg", 21, @"c:\test\test.jpg");

See Also

ImageKit.File Members | Newtone.ImageKit.Wpf.ImageKit

The ImageKit WPF is created by Newtone Corporation