vb Code:
Dim session As Long, server As Long, ftpserver As String, user As String, pass As String
Dim ret As Long, localfile As String, remotefile As String
ftpserver = ""
user = ""
pass = ""
localfile = App.Path & "\" & fname
remotefile = fname
session = InternetOpen(App.EXEName, INTERNET_OPEN_TYPE_DIRECT, vbNullString, vbNullString, INTERNET_FLAG_NO_CACHE_WRITE)
server = InternetConnect(session, ftpserver, INTERNET_INVALID_PORT_NUMBER, user, pass, 1, 0, 0)
ret = FtpPutFile(server, localfile, remotefile, FTP_TRANSFER_TYPE_BINARY, 0)
InternetCloseHandle server
InternetCloseHandle session
here is as simple as it can get, this is from a working app, i have removed the ftp details as you can see
i never use c:\ to write files to so as you can see i used app.path in this case, the file is copied to the root folder on the ftp server by default, fname was passed to the sub from the calling sub