curl - How to force download of an .mp4 file by PHP headers from external url? -
i unable find answer regarding headers. have .mp4 file hosted on website a , force download using button on website b. possible without downloading file website b , serving user?
i have pulled necessary data website b, in order download file, user needs right click save on button.
here's use (php) $cf contains path file being requested. may want download script stored on server b makes happen , link script download .. http://link.to.script/script.php?file=thefilename.mp4'>download wouldn't put filename in url example.
header('content-disposition: attachment; filename="' . basename($cf) . '"'); header("content-length: " . filesize($cf)); header("content-type: application/octet-stream"); readfile(realpath($cf));
Comments
Post a Comment