Question

I am designing a system in which I need to download an image file to my computer as soon as it is submitted/uploaded to my server via a web form. I am on a mac, so I am going to use Automator to complete the task with the image once it is on my computer.

Is there a php script that I haven't stumbled across yet that can do this? Or do I have to listen for changes on the server from my computer? I'd really appreciate it if someone could point me in the right direction as I have no idea where to start looking for something like this!

Thanks in advance!

Was it helpful?

Solution

You can install a ftp server on your mac and make the web server send it to you when it gets uploaded. This is the instant way. Another way is to make a script on your mac that polls the web server every X seconds/minutes to see if there is a new file to be downloaded.

OTHER TIPS

A few options that come to mind:

  1. Create a callback script on your computer that gets called/informed that there is a new file uploaded on the server as soon as the file is uploaded, and since your computer now knows that there is a new file, it can download it instantly through the script.
  2. Create a form submit script on your computer where the file can be instantly "uploaded" / submitted through the server handling script either through a similar form or using CURL
  3. As suggested in the comment, an ftp server running on your local pc, where the script can upload via FTP
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top