Answers for "php get file from another server"

PHP
0

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);
?>
Posted by: Guest on November-16-2020

Code answers related to "php get file from another server"

Browse Popular Code Answers by Language