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.
Automated FTP download from server?
-
12-07-2023 - |
Pergunta
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!
Solução
Outras dicas
A few options that come to mind:
- 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.
- 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
- As suggested in the comment, an ftp server running on your local pc, where the script can upload via FTP
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow