GdPicture.NET Reference Guide
UploadFileToFTP Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : UploadFileToFTP Method
The full file path of the file to upload, for example "d:/images/myimage.jpg".
The host server name, for example "ftp.com".
The full file path of the file to create on the distant server, for example "/demo/image.jpg".
The user's login required to authenticate on the server.
The user's password required to authenticate on the server.
The FTP port number used. It is usually 21.
Uploads a specified file to a distant server using FTP transfer according to what you have specified.
Syntax
'Declaration
 
Public Function UploadFileToFTP( _
   ByVal FilePath As String, _
   ByVal Host As String, _
   ByVal Path As String, _
   ByVal Login As String, _
   ByVal Password As String, _
   ByVal FTPPort As Integer _
) As GdPictureStatus
public function UploadFileToFTP( 
    FilePath: String;
    Host: String;
    Path: String;
    Login: String;
    Password: String;
    FTPPort: Integer
): GdPictureStatus; 
public function UploadFileToFTP( 
   FilePath : String,
   Host : String,
   Path : String,
   Login : String,
   Password : String,
   FTPPort : int
) : GdPictureStatus;

Parameters

FilePath
The full file path of the file to upload, for example "d:/images/myimage.jpg".
Host
The host server name, for example "ftp.com".
Path
The full file path of the file to create on the distant server, for example "/demo/image.jpg".
Login
The user's login required to authenticate on the server.
Password
The user's password required to authenticate on the server.
FTPPort
The FTP port number used. It is usually 21.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK. We strongly recommend always checking this status first.
Example
How to upload an image file to a distant server using FTP transfer.
Dim caption As String = "Example: UploadFileToFTP"
Using oImage As GdPictureImaging = New GdPictureImaging()
    oImage.SetFtpPassiveMode(True)
    oImage.SetHttpTransferBufferSize(8192)
    If oImage.UploadFileToFTP("myimage.jpg", "ftp.com", "d:/images/image.jpg", "GdPictureUser", "Password123", 21) = GdPictureStatus.OK Then
        MessageBox.Show("The image has been uploaded successfully.", caption)
    Else
        MessageBox.Show("The image can't be uploaded. Status: " + oImage.GetStat().ToString(), caption)
    End If
End Using
string caption = "Example: UploadFileToFTP";
using (GdPictureImaging oImage = new GdPictureImaging())
{
    oImage.SetFtpPassiveMode(true);
    oImage.SetHttpTransferBufferSize(8192);
    if (oImage.UploadFileToFTP("myimage.jpg", "ftp.com", "d:/images/image.jpg", "GdPictureUser", "Password123", 21) == GdPictureStatus.OK)
        MessageBox.Show("The image has been uploaded successfully.", caption);
    else
        MessageBox.Show("The image can't be uploaded. Status: " + oImage.GetStat().ToString(), caption);
}
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
SetHttpTransferBufferSize Method
SetFtpPassiveMode Method
CreateGdPictureImageFromHTTP(String,String,Int32) Method
CreateGdPictureImageFromFTP Method