wwftp::FTPSendFileEx2

Uploads a file to an FTP site. Works the same as FtpSendFileEx() except it uses a single WinInet PutFile() operation and doesn't provide individual file progress information.

Works better for small files where individual file progress information is not required. This function maybe more reliable than FtpSendFileEx().

o.FtpSendFileEx2(lcSourceFile, lcTargetFile)

Return Value

numeric - 0 success anything else: WinInet Error Code

Parameters

cSourceFile
Local file to send to the server. Use a fully qualified path and file name.

cTargetFile
Filename on the server to copy the file to. Path is server relative to the server's current FTP folder.

Examples:
somefile.txt
subdir/somefile.txt
subdir/subdir/somefile.txt

Remarks

This method does not report progress to OnFtpBufferUpdate()

You must have rights to write to the FTP directory based on the FTP server permissions. Write permissions are not granted to FTP directories by default, so you have to make sure that you can upload files in the first place. You can check this out with your regular FTP client.

Example

o=create("wwFTP")

o.FTPConnect("ftp.west-wind.com")
o.FTPSendFileEx("c:\temp\pkzip.exe","downloads/pkzip.exe")
o.FTPClose()

See also:

Class wwFtp (deprecated) | wwFTP::OnFTPBufferUpdate | wwFTP::lCancelDownload

© West Wind Technologies, 1996-2024 • Updated: 11/25/13
Comment or report problem with topic