tags:

views:

398

answers:

3

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?

+4  A: 

libCURL is a library; it acts as the client.

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

Joe
Thanks Joe. I sort of got thrown into this and I'm trying to get the hang of it.
Keli Handler
A: 

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.

Alex
That does make it super clear. I get it now.
Keli Handler
@Alex: In this case, if I'm reading it right, the OP's architecture is their server doing FTP pushes to the client, so you've got it backwards. Keli's webserver is uploading files to the clients' FTP servers. Keli's server needs a webserver and libcurl; client side needs FTP servers.
Joe
A: 

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.

Klinky