Download file from source URL to destination server path. PHP function “fopen” read and write to destination path of the server.
1 2 3 4 5 6 7 8 9 10 11 12 |
<?php // $sourc_url = "http://sorcepath/sorcefile.txt"; $desctination_path="folder/s11.txt"; $src = fopen($sourc_url, 'r'); $dest = fopen($desctination_path, 'w'); stream_copy_to_stream($src, $dest); ?> |
More Stories
CPU & Memory usage in PHP
Install PHP mcrypt extension on Ubuntu
Text to speech