• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4520
  • 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.
1 Solution
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

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:
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
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

Open in new window

CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Olaf DoschkeSoftware DeveloperCommented:
specifically for VFP


libcurl (FTP, FTPS besides others):

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.
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.
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
I have heard of many users happily using tools from:

I never tried them though. I always write my own code.
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
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.
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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