[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4174
  • Last Modified:

VFP FTP File Transfer

Hi all. I'm looking to transfer files to and from an FTP server.
I know this isn't a simple task in FP and I think I've researched and looked at just about every available option there is.

So far I haven't been able to find anything the 1) actually works in my tests, or 2) that I would know how to implement.

So I was wondering if anyone here has some suggestions of things they've tried and used.
0
formadmirer
Asked:
formadmirer
1 Solution
 
aadi369Commented:
Files can be transferred between a pair of machines with FTP.

There are a number of parameters that are necessary to know when connecting to an FTP server.

FTP server name or IP address
Port number
Username
Password

There are three basic ways to communicate with an FTP server.
Use a web browser as your FTP client
Use the command-prompt FTP client
Use a graphical FTP client

For more details and step by step solution, refer below article:
http://www.uic.edu/depts/accc/network/ftp/vftp.html
0
 
CaptainCyrilCommented:
I used these to download FTP and HTTP files:

DECLARE INTEGER InternetOpen IN wininet.DLL STRING sAgent, INTEGER lAccessType, STRING sProxyName, STRING sProxyBypass, INTEGER lFlags
DECLARE INTEGER InternetConnect IN wininet.DLL INTEGER hInternetSession, STRING cServerName, INTEGER nServerPort, STRING cUserName, STRING cPassword, INTEGER nService, INTEGER nFlags, INTEGER nContext
DECLARE INTEGER InternetSetOption IN wininet.DLL INTEGER hInternet, INTEGER nOption, STRING @lpBuffer, LONG nBufferLength
DECLARE INTEGER InternetOpenUrl IN wininet.DLL INTEGER hInternetSession, STRING sUrl, STRING sHeaders, INTEGER lHeadersLength, INTEGER lFlags, INTEGER lContext
DECLARE INTEGER InternetReadFile IN wininet.DLL INTEGER hfile, STRING @sBuffer, INTEGER lNumberofBytesToRead, INTEGER @lBytesRead
DECLARE SHORT InternetCloseHandle IN wininet.DLL INTEGER hInst
DECLARE LONG URLDownloadToFile IN URLMON.DLL LONG, STRING, STRING, LONG, LONG

Open in new window

0
 
CaptainCyrilCommented:
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Olaf DoschkeSoftware DeveloperCommented:
specifically for VFP

VFPConnection.fll:
http://www.sweetpotatosoftware.com/spsblog/2008/12/05/VFPConnectionUpdateHTTPPostFTPCommandsAndMore.aspx

libcurl (FTP, FTPS besides others):
http://www.ctl32.com.ar/libcurl.asp

You can even use DOS FTP or the Microsoft Internet Transfer ActiveX Control, which besides others comes with VFP and can be redistributed.

Bye, Olaf.
0
 
peterhuppCommented:
I have been using VFPConnection.fll that Olaf suggested above for years without issue.  Lots of sample code and very easy to use.  I would highly recommend.
0
 
CaptainCyrilCommented:
I have heard of many users happily using tools from:
http://www.west-wind.com/

I never tried them though. I always write my own code.
0
 
jrbbldrCommented:
For years I have been successfully using FTPPut and FTPGet with my client's VFP applications

Admittedly, when I first started working with these I had to communicate with technical support on the 'other' end to get all of the parameters correct - such as TargetDir, FileType (Binary or ASCII), Target Directory slashs (forward or backward), Port (default - 21 for FTP or 22 for SFTP), etc.  

But once the configuration was correctly established, things have run consistently well.

I'd suggest this route since it was pretty simple to do.

Good Luck
0
 
formadmirerAuthor Commented:
Of the solutions I've looked at suggested here and elsewhere I think I like VFPConnection.fll the best. As soon as I get the time I am going to see just what it will take to implement it.

As for FTPPut and FTPGet, I am not familiar with them but I am assuming they are similiar to Wget and Wput which I have been using for a while now without issue. Ok, maybe one.

Actually, while I'm thinking about it I will post another question addressing suppressing the command window popup with Wput/get since that will be a big issue here shortly that I will need to address.

Many thanks to all who replied.
0
 
Olaf DoschkeSoftware DeveloperCommented:
Wget does offer a lot more than just simple ftp or http get,put etc. It allows retry, recursive requests and more. So it is a nice tool, but you can replace it, if you just get ftp or http URLs anyway, and that would help lower the number of components used, the complexity and give a better maintainability. So if that wget window annoys you, and you don't use it's advanced features, then go for VFPConnection.fll, yes, it offers all the simple types of requests.

Bye, Olaf.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now