开发者

FTP upload of the web-accessible file placed on a 3rd party server without prior downloading

开发者 https://www.devze.com 2023-02-22 14:38 出处:网络
How to, using PHP script placed on server(A) upload file located on server(B)* throught FTP to server(C) without downloading the file?

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), wh开发者_Python百科ich 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
0

精彩评论

暂无评论...
验证码 换一张
取 消