cURL - copy image file from one server to another

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • friglob

    cURL - copy image file from one server to another

    i would need help with creating some cURL code...

    $old_file = "http://my_host.com/images/test.jpg";
    $new_destinatio n = "http://some_other_host .com/archived_images ";

    i was trying to create a cURL code that would copy the $old_file to a $new_destinatio n but did not have much success...
    basicaly i need to copy the file to the new server and if succedded, delete the original on old server

    can somebody give me a hint with this?
  • Rik

    #2
    Re: cURL - copy image file from one server to another

    friglob wrote:
    i would need help with creating some cURL code...
    >
    $old_file = "http://my_host.com/images/test.jpg";
    $new_destinatio n = "http://some_other_host .com/archived_images ";
    >
    i was trying to create a cURL code that would copy the $old_file to a
    $new_destinatio n but did not have much success... basicaly i need to
    copy the file to the new server and if succedded, delete the original
    on old server
    It would be a hell of a lot easier if you do it by FTP rather then cURL.
    How do you propose you can delete a file by HTTP, or store (yes, PUT, very
    rare)?
    --
    Rik Wasmus


    Comment

    Working...