Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php get file from another server

<?php
    $url  = 'http://www.example.com/a-large-file.zip';
    $path = '/path-to-file/a-large-file.zip';

    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $data = curl_exec($ch);

    curl_close($ch);

    file_put_contents($path, $data);
?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #file #server
ADD COMMENT
Topic
Name
9+6 =