o.cFTPServer="ftp.west-wind.com" o.cFTPSource="c:\temp\wwcgierr.txt" o.cFTPTarget="/uploads/wwcgierr.txt" *** Use passwords if Anonymous is not allowed. * o.cUsername="username" * o.cPassword="password" IF o.FTPSendFile() # 0 ? o.cErrorMsg ENDIF
You can also use the lower level method FTPSendFileEx which allows more control over how the file is sent. This method allows for message events to be fired that you can catch and allow you to display status information. For details see the documentation for this method. This method also allows you to send multiple files to be sent without reconnecting for each file. The basic syntax for this method is:
o=create("wwFTP")
o.FTPConnect("ftp.west-wind.com")
o.FTPSendFileEx("/downloads/pkzip.exe","c:\temp\pkzip.exe")
o.FTPSendFileEx("/downloads/pkunzip.exe","c:\temp\pkunzip.exe")
o.FTPClose()