I’m creating a backup system, where backups will be generated automaticly, so I will be storing backups on a different server, however when I want to download them, I want the link to be a one time link, this isn’t hard to make, however to make this secure I was thinking about storing the files so their not accesible via http on the other server.
So what I would do is connet via ftp, download the file to the main server, then present it for download and deleteit, however this will take a long time if the backup is large, is there a way to stream it from FTP without showing the person who is downloadiong the actual location and not store it on the server?
Here is a very basic example using cURL. It specifies a read callback which will be called when data is available to be read from FTP, and outputs the data to the browser to serve a simultaneous download to the client while the FTP transaction is taking place with the backup server.
This is a very basic exmaple which you can expand on.
See curl_setopt() for more info on the
CURLOPT_READFUNCTIONoption.