Search
 
SCRIPT & CODE EXAMPLE
 

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);
?>
Comment

PREVIOUS NEXT
Code Example
Php :: php file_put_contents 
Php :: php function return multiple values 
Php :: get the matched value from 2 array in php 
Php :: Create progress bar with Laravel 
Php :: wordpress login programmatically 
Php :: php get parent url from script location 
Php :: redirect to intent url after login laravel 
Php :: php 7 The each() function is deprecated. 
Php :: how to prevent the Undefined index in php 
Php :: get HTML select value to PHP 
Php :: bind param php 
Php :: php link 
Php :: laravel collection shift 
Php :: php get api 
Php :: wordpress get default date format 
Php :: laravel create method 
Php :: how to set 1 year date without saturday in while loop php 
Php :: submit form and show results on same page without refresh 
Php :: how to use or where in laravel 
Php :: return single row from eloquent all collection laravel 
Php :: @yield extends laravel 
Php :: array map php 
Php :: autoloading classes 
Php :: laravel crud application 
Php :: laravel sanctum authentication 
Php :: enable phpmailer cpanel 
Php :: cakephp 3 make migration 
Php :: create seed file from db laravel 
Php :: how to run a php file using 
Php :: multiple value match in array php 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =