corecodeschool.blogspot.com: How to download direct any file using php code

Enter Keyword Hear for Search This Blog

Monday, 7 March 2016

How to download direct any file using php code

download.php

<?php

$getfile="https://www.demo.com/bollywood/videos/2.mp4";

header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$getfile);
header('Content-Transfer-Encoding: binary');

$file = @ fopen($getfile, 'rb') or die("Techincal Error");    

fpassthru($file);
        
?>

No comments:

Featured post

Contact

Contact Core Code School Core Code School shares beginner-friendly tutorials on PHP, HTML, CSS, JavaScript, Java, SQL and Ubuntu. You can...