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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp'ing out of vfp

Status
Not open for further replies.

timp4christ

IS-IT--Management
May 30, 2006
1
US
I have the code to ftp out of my vfp program, but it only works when I can directly login to the ftp site...example.. ftp.vhitransport.com

The problem is that where I need to copy the file to is on folder vahwy ie. ftp.vhitransport.com/vahwy

When I try to logon to ftp.vhitransport.com/vahwy the connection fails, so i need some way to log on to the main ftp site, change the directory to vahwy and then transfer the file....but the code I orginally got was from this site, and I have no idea how to make this happen...the code I got was working through wininet.dll and I don't know enough about how that works to really do anything with it...if anyone can help, i would appreciate it.

Thanks,

Tim
 
We use something like:

Code:
    lcScript =  "open ftp.vhitransport.com" + CHR(10) +;
	"ftp" + CHR(10) + ;
	"ftp" + CHR(10)+ ;
	"binary" + CHR(10) + ;
					
	"cd ./vahwy" + CHR(10) + ;
	"lcd " + lcDataFolder + CHR(10) + ;
	"put " + [file1_]+ DTOS(ldDate)+[.csv]+ CHR(10) + ;
	"put " + [file2_]+ DTOS(ldDate)+[.csv]+ CHR(10) + ;
	"put " + [file3_]+ DTOS(ldDate)+[.xls]+ CHR(10) + ;
	"bye"

    STRTOFILE(lcScript,"ftpscript.txt")
    RUN ftp -i -s:ftpscript.txt
 
Hi Tim

Like you have been trying to find a way to easily ftp from VFP. There are lots of postings on this subject in the VFP forums here, but the I think I found the same code as you, posted by Dave Summers and using wininet.

I found this one simple to use .... after spending a while trying to figure it out!

The problem I found was that my own web server, where I was trying to take files from and send them to, wanted // instead of a / from me. You also need to be aware of some web servers being case sensitive.

I don't know if this is your problem, but as soon as I added the extra slashes to my web site address and it's folders I was up and running. I simply passed through the host name, folder and file, user name and password and it was away.

Dave
 
I have been doing this for years ! My method is to create a batch file with fcreate etc, then closing it wait a sec then run it.

Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top