Usually we download the files hosted in same server using php, but in this tutorial we are showing how to download a file hosted in remote server.
// File in remote host $url = 'https://img.youtube.com/vi/HvCpSfkNrms/maxresdefault.jpg'; //download header("Content-type: application/x-file-to-save"); header("Content-Disposition: attachment; filename=".basename($url)); ob_end_clean(); readfile($remoteURL); exit;
Leave a Reply