Re: Downloading movies / forcing download

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi again,
forgot to mention, in FF when i try to save the file... it does not save it... although it shows the filename in the download folder.. the file is just 4k for some reason where as the original file is something like 40mb

Thanks,
Ryan


================================================



Hey!

Heres my requirment, the movie clips are below the root and after the member pays for access the client want to let the user download the flick and add the sitename to the flicks filename (for example if the filename is a.avi it should download as test-a.avi)

heres the code i haev come up with so far... the download box pops up in FF but in IE it gives me the website cannot be found error

======================= code =========================
<?php

$directory_path ="C:\\xampp2\\htdocs\\";
$file_name="Fitna[English].avi";

$file_to_download=$directory_path.$file_name; 
$user_agent = strtolower ($_SERVER["HTTP_USER_AGENT"]);
header( "Content-type: application/force-download" );
if ((is_integer (strpos($user_agent, "msie"))) && (is_integer (strpos($user_agent, "win")))) 
{header( "Content-Disposition: filename="."test-".$file_name);
}else{header( "Content-Disposition: attachment; filename="."test-".$file_name);
    }
header( "Content-Description: File Transfert");
@readfile($file_to_download);

?>done!
========================================================


Any suggestions as to how i can improve the code and also how to get the above to work?

Thanks in advance!
R

------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)


      

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux