The FTP protocol is a low-level protocol used to simulate the action of the user on the ftp server, such as landing, transfer files, disconnected operation
The script can be generated by recording the FTP session or manually enter ftp function
Steps:
Open vuser, the new catalog select E-business, select the ftp protocol
Pop-up recording options, select ie, or win32 applications (ftp client)
3.ftp operation finished recording, generate the script
Commonly used functions:
* ftp_login
Log ftp
Syntax: init ftp_logon (char * transaction char * url [attributes] LAST);
Example: ftp_logon (FTPlogon, URL = ftp://test1:123456 @ servaername: port ", LAST);
If anonymous users compared with anoymous, the port number can be omitted
* ftp_logout: canceled ftp connection
Syntax: int ftp_logout ()
Example: ftp_logou ();
* ftp_Logon_ex specified session login ftp
Syntax: int ftp_logon_ex (FTP * ppftp, char * transaction, char * url attributes,] LAST);
Example: ftp1 = 0;
ftp_logon_ex (& ftp1, "ftplogon", "url = URL = ftp://test1:123456 @ servaername", last)
* ftp_put to upload files to ftp server
Syntax: int the ftp_put (char * transaction <item list> LAST);
Example: the ftp_put (the "the ftp_put" "source_path ftpfile_1.dat", "target_path = temp / test.txt" LATS);
* ftp_get get the file from the ftp server
Syntax: int ftp_get (char * transaction <item list> LAST);
Example: ftp_get ("ftp_get", "source_path = / home / test.txt", "target_path = d :/ test.txt", the "PASSIVE = TRUE" ENDITEM, LATS);
the * ftp_dir specified directory Run the dir command
Syntax: int ftp_dir (char * transaction <item list> LAST);
Example: ftp_dir (the "ftp_dir, path = pub / test" LAST);
Display the files and subdirectories in the test directory
* ftp_delete: delete the ftp file
* ftp_rendir: rename files
* ftp_rmdir: delete folders
* ftp_mkdir: create a folder
没有评论:
发表评论