glenelkins Posted December 27, 2006 Share Posted December 27, 2006 Im trying to download WMV files with php. The files appear to download fine but they wont open. Here is my code [code]// First get the video$video = $_GET['vid'];$file_name_tmp = explode("/",$video);$file_name = $file_name_tmp[2];$file_path = "http://www.lostbum.com/$file_name_tmp[1]/";echo $file_path . $file_name;// send the necessary headers.header("Content-Type: application/octet-stream");header("Content-Disposition: attachment; filename=$file_name");header("Content-transfer-encoding: binary\n"); header("Content-length: " . filesize($file_path.$file_name) . "\n"); // open the file for reading and start dumping it to the browser$fp=fopen($file_path.$file_name, "r"); fpassthru($fp); [/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.