vb Code:
  1. Dim session As Long, server As Long, ftpserver As String, user As String, pass As String
  2. Dim ret As Long, localfile As String, remotefile As String
  3. ftpserver = ""
  4. user = ""
  5. pass = ""
  6. localfile = App.Path & "\" & fname
  7. remotefile = fname
  8.  
  9. session = InternetOpen(App.EXEName, INTERNET_OPEN_TYPE_DIRECT, vbNullString, vbNullString, INTERNET_FLAG_NO_CACHE_WRITE)
  10. server = InternetConnect(session, ftpserver, INTERNET_INVALID_PORT_NUMBER, user, pass, 1, 0, 0)
  11. ret = FtpPutFile(server, localfile, remotefile, FTP_TRANSFER_TYPE_BINARY, 0)
  12. InternetCloseHandle server
  13. 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