Skip to content

Instantly share code, notes, and snippets.

@MikeWills
Created August 1, 2013 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeWills/d004f1d89f57cfa8de9e to your computer and use it in GitHub Desktop.
Save MikeWills/d004f1d89f57cfa8de9e to your computer and use it in GitHub Desktop.
localFile = file;
file = %trim(%subst(file:6));
// Connect to the FTP server
fd = FTP_open(server:port);
if (fd < 0);
CompMsg(FTP_errorMsg(0));
return;
endif;
FTP_logging(fd: *on);
// Log in
rc = FTP_login(fd:username:password);
if (rc < 0);
FTP_errorMsg(fd:ErrNum);
CompMsg(FTP_errorMsg(fd));
FTP_quit(fd);
return;
endif;
//FTP_IFS_usage(fd:'I');
if (FTP_chdir(fd:'DropOff/') < 0);
CompMsg(FTP_errorMsg(fd));
FTP_quit(fd);
return;
endif;
// Put the file
if FTP_put(fd:file:localFile) < 0;
CompMsg(FTP_errorMsg(fd));
FTP_quit(fd);
return;
endif;
FTP_quit(fd);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment