FTP上传放置在第三方服务器上的Web可访问文件,无需事先下载

How to, using PHP script placed on server(A) upload file located on server(B)* throught FTP to server(C) without downloading the file?

*the only known/accessible URL of the file points to server(Z), which 301-redirects to the original file on server(B)

Should be moderately simple:

  • Use cURL with redirect following to download the file from Z-B to A
  • Create check sum of file on A
  • Use FTP to upload the file from A to C
  • Download file on C to file A and create checksum
  • Validate upload with checksum comparison
  • Remove file from A if no longer needed