FTP upload of the web-accessible file placed on a 3rd party server without prior downloading
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
精彩评论