Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send and receive DBFs from FTP site

Status
Not open for further replies.

SSDESIGN

Programmer
May 11, 2003
71
US
A second store is being opened using the same software as the main store. The main store will control adding new product to the application. Once added, a DBF will be created containing the new inventory items. How can the application be modified so the new item DBF can be sent to a FTP site and then downloaded by the second store from the FTP site?

Can this be done from within FPD 2.6 or must it be done in a batch file?

Thanks for the support...
 
It has been so long since I have had to write anything in FP2.6 that I cannot say for certain, but you might want to do a Search for FTP over in the VFP forum to find a variety of answers.

Once you have those answers you can test them in FP2.6

Good Luck,
JRB-Bldr
 
I have a Fox app that uses FTP to transfer text reports from a mainframe host. All it does is use the ! (RUN) command to run the windows ftp, after it makes a local ftp script file:

Code:
ftpfile = FCREATE("FTPXFER.TMP")
IF ftpfile < 0
   WAIT WINDOW "File open Error. Unable to create receive file for x-fer"
   RETURN
ENDIF ( ftpfile < 0 )

STORE 'SomeFile.txt' TO cLocal       &&... receive file name

=FPUTS(ftpfile, 'open 10.10.10.10')  &&... host ip goes here
=FPUTS(ftpfile, "yourusername")      &&... host username
=FPUTS(ftpfile, "yourpassword")      &&... host password
=FPUTS(ftpfile, 'get ' + cRemote + ' ' + cLocal)  
=FPUTS(ftpfile, 'bye')
=FCLOSE(ftpfile)

WAIT WINDOW 'Transferring file ...' NOWAIT
&&.... '-v' supresses replies from ftp server, '-s:' script file
! /n ftp -s:ftpxfer.tmp -v   
WAIT CLEAR 

RETURN

You could modify the script to 'put' as well as 'get' by switching the local and remote file names around.



-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top