Transfer files between two remote FTP servers in PHP

后端 未结 1 584
心在旅途
心在旅途 2021-01-15 00:57

First of all, I know that this a duplicate topic, but the other post that I found were not useful for my situation, so I decided to create a new one.

What I\'m tryin

1条回答
  •  北海茫月
    2021-01-15 01:26

    Both ftp_get and ftp_put can operate with files only, not folders.

    Use ftp_get to download a file from the first server to a local temporary folder/file. And then use ftp_put to upload the temporary file to the second server.


    If you want to avoid using a temporary file, you can download the file to memory using ftp_fget and re-upload to the second server using ftp_fput.

    • PHP: How do I read a .txt file from FTP server into a variable?
    • Transfer in-memory data to FTP server without using intermediate file

    0 讨论(0)
提交回复
热议问题