Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
ftpputfile (wininet)
 
.
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

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions