saving file locally and remotely at the same time using PHP
At my office, we get lots of incoming files. They need to be saved on a PC on a local network, and they need to be uploaded to a remote server.
Instead of making the staff go through 2 steps, what i want is to write a PHP script that will 1) save the file to the remote server, and then 2) save it to a specific location on the network PC.
or maybe a compromise, where after the file is uploaded to the remote hosted server, a dialogue box appears asking the user to save the file locally to their PC, preferably with the path spelled out so the user saves the file to the right folder.
the good news is i can use the php script to determine 1) if the folder and file exists already, and if not, i can create a folder with the right name, and then upload the file with the right name
the bad news is, once a client emails this document, we need to *also* save it to a PC on the local network, where the folder in the location we want the file to go may, or may not exist.
i want to take having to 'think' about what the folder and file name should be, or where it is supposed to be saved, i just want the user to be able to easily have the file saved to the PC on the local network in the same easy way i can do it with the *remote* server
i have looked for weeks and cant find anything. i would think somebody out there might have wanted this as in our case it will save a lot of time and make the process of managing and storing incoming client files that much easier
You just need to know what these different machines are running...for example if you php server is Linux, and your remote server you wish to save the file to is Windows, you can mount the remote to a folder on the web server (or do an NFS mount if the remote is linux also).
You could also use Curl to FTP the file to another server
Or, you could also just save the file to a directory on the webserver that has been shared through Samba...then anyone can get to it through a mapped network drive.
It just all depends on what OS / Services are running on which systems...Once you have defined the nodes in the environment, that will decide exactly how you get the files across the network.
We do precision guesswork
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)