Question

I'm trying to wrap my brain about how to do this. We need to provide some files within a directory from our servers to our clients' servers via a PHP/Web interface using FTP. I've looked at the FTP capabilities built in to PHP and some custom classes, but someone suggested cURL might be a better option. We will have the FTP login credentials in our database for the application to access. With that information can we use cURL FTP capabilities to do the transfers, knowing our server has libcurl installed, but the clients servers may not? Do both servers have to have it for the FTP function to work?

Or am I completely going about this the wrong way, and have misunderstood how to use cURL and should be looking into an FTP PHP class?

Was it helpful?

Solution

Just to make it super clear, there are 2 computers involved:

  • Your server, the one that's supposed to provide files to the client using the FTP protocol. That server does not need to have a web server (or PHP) running. The only thing it needs is an FTP server. It also needs to have permissions configured in such a way that there is an account that can access the files through FTP.

  • Your client's server, the one that's supposed to retrieve files from your server using the FTP protocol. That server needs to have PHP installed, with libCurl. The software on that server needs to access your server using the FTP protocol, providing the user credentials that you configured on your box.

Hope that helps.

OTHER TIPS

libCURL is a library; it acts as the client.

Your clients need to be running a FTP server but do not need libCURL.

It sounds like what you want to do is have the client connect to your PHP script & then push a button to start an FTP transfer that sends a file from your FTP server to their FTP server. If this is the case, then all you need is cURL on your server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top