This method uploads the existing file to the FTP server with specified URI.
[Visual Basic] Public Function UploadFile(ByVal
remoteAddress As String, ByVal localFileName As String) As
Boolean
[C#] public bool UploadFile(string
remoteAddress, string localFileName);
Parameters
- remoteAddress
- The URI where the file is uploaded
- localFileName
- Local file name
Return Value
Returns True if successful. Returns False if unsuccessful.
Explanation
The UploadFile method uploads the existing file to the FTP server with specified URI.
This method is effecitive for the FTP protocol.
Example
[Visual Basic.NET] Dim _ftp As New Newtone.ImageKit.Ftp Dim Ret As Boolean 'Username and password _ftp.Credentials = New NetworkCredential("user", "password") 'Enables passive mode connectivity _ftp.Passive = True 'Uploads the file Ret = _ftp.UploadFile("ftp://www.newtone.co.jp/test/test.jpg", "c:\test\test.jpg") [Visual C#.NET] Newtone.ImageKit.Ftp _ftp = new Newtone.ImageKit.Ftp(); bool Ret; //Username and password _ftp.Credentials = new NetworkCredential("user", "password"); //Enables passive mode connectivity _ftp.Passive = true; //Uploads the file Ret = _ftp.UploadFile("ftp://www.newtone.co.jp/test/test.jpg", @"c:\test\test.jpg");