Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DOS FTP syntax
Message
De
03/09/1999 17:05:58
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
Divers
Thread ID:
00261371
Message ID:
00261391
Vues:
39
> Can anyone tell me what is the complete syntax for a DOS ftp command to transfer a file to the host(with no prompt)?

If you wish to automate the process from within FoxPro, you can use a script file. The script file contains all the commands that the user would normally do interactively. To get a list of commands, go to a DOS window, type "ftp" then at the FTP prompt, type "help".

The following is an example:
Function FTP
Parameter Filename, FTPSite, Username, PassWord

CRLF = Chr(13)+Chr(10)
nFile = FCreate("ftp.txt")

* Open connection to FTP Site and log in
=FWrite(nFile, "open "+FTPSite+CRLF+Username+CRLF+Password+CRLF)

* Force lowercase transmition
=FWrite(nFile, "glob off"+CRLF)

* Force ASCII transmition
=FWrite(nFile, "ascii"+CRLF)

* Force Binary transmition
=FWrite(nFile, "binary"+CRLF)

* If you want to get the file from the FTP Site
=FWrite(nFile, "get "+Filename+CRLF)

* If you want to put the file on the FTP Site
=FWrite(nFile, "put "+Filename+CRLF)

* End the connection and close FTP
=FWrite(nFile, "quit"+CRLF)

* Close the script file
=FClose(nFile)

* Change current drive in DOS
cFTPCmd = sys(5)
! &cFTPCmd
! ftp -s:ftp.txt
Melissa Danforth
Customsoft Corporation
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform