ftpputfile (wininet)
Last changed: -161.49.198.69

.
Summary
Stores a file on an FTP server.

C# Signature:

[DllImport("wininet.dll", SetLastError=true, CharSet=CharSet.Auto)]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool FtpPutFile(IntPtr hConnect, string lpszLocalFile, string lpszNewRemoteFile, int dwFlags, IntPtr dwContext);

VB Signature:

Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" (ByVal hFtpSession As IntPtr, ByVal lpszLocalFile As String, ByVal lpszRemoteFile As String, ByVal dwFlags As Integer, ByVal dwContext As Integer) As Boolean

User-Defined Types:

None.

Notes:

Call InternetOpen() and InternetConnect() to get a valid hConnect handle.

// dwFlags

Use one of these values to control the transfer type:

const int FTP_TRANSFER_TYPE_UNKNOWN = 0x00000000;  // Defaults to FTP_TRANSFER_TYPE_BINARY
const int FTP_TRANSFER_TYPE_ASCII   = 0x00000001;
const int FTP_TRANSFER_TYPE_BINARY  = 0x00000002;

Another way to say it, this one in VB style:

Const INTERNET_FLAG_TRANSFER_BINARY As Integer = &H2

Use one or more of these flags to control file caching:

const int INTERNET_FLAG_HYPERLINK = 0x00000400;  
const int INTERNET_FLAG_NEED_FILE   = 0x00000010;
const int INTERNET_FLAG_RELOAD  = 0x80000000;
const int INTERNET_FLAG_RESYNCHRONIZE  = 0x00000800;

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!

Documentation
FtpPutFile on MSDN