What is the best way to move files from one server to another with PHP?

前端 未结 4 427
灰色年华
灰色年华 2020-12-29 16:16

I want to setup a CRON that runs a PHP script that in turn moves XML file (holding non-sensitive information) from one server to another.

I have been given the prop

4条回答
  •  没有蜡笔的小新
    2020-12-29 16:33

    I had some similar situation. After some tries, I did some thing different

    We have 2 servers, a (that have the original files) b (files should moved to it)

    And for sure the data is NOT sensitive

    Now in server a I made a file to do the following when called: 1. Choose the file to move 2. Zip the file 3. Print the .zip file location 4. Delete the .zip file (and the original file) if delete parameter passes

    In the server b the file should do: 1. Call the file on the a server 2. Download the zip file 3. Unzip and copy it to the proper location 4. Call the delete function on server a

    This way I have more control on my functions, tests and operations!

提交回复
热议问题