Created
April 12, 2023 06:42
-
-
Save prashantdsala/493f19012455f5689b99811e2b2a1e7c to your computer and use it in GitHub Desktop.
PHP - Download file using "wget"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function __callURLinBackground($url) { | |
exec("wget -bqc ".$url." -P /var/www/html/", $output, $result_code); | |
echo $output; | |
echo $result_code; | |
echo '<pre>';print_r($output); | |
echo '<pre>';print_r($result_code); | |
echo 'Running in background'; | |
} | |
// call a URL in background | |
__callURLinBackground('https://sample-videos.com/csv/Sample-Spreadsheet-10-rows.csv'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment