I downloaded a flv vedio file from server using php successfully, but when I tried to play the same downloaded file it was not playing..
Also when I checked its time for which it being played in a player it showed me zero sec.
What might be the problem?
I want know how to sort out that problem,the same code is working for mp3 file without any error.
Here is my code:
could you please let me know what would i have to change so that the .flv vedio play too.
thank you
Also when I checked its time for which it being played in a player it showed me zero sec.
What might be the problem?
I want know how to sort out that problem,the same code is working for mp3 file without any error.
Here is my code:
Code:
if(isset($_GET['id']))
{
echo $sql = "select * from file_details where file_id='".$_GET['id']."'";
$rsl = mysql_query($sql) or die("Error! query failed");
echo $name = stripslashes(mysql_result($rsl,0,'file_name'));
echo $type = stripslashes(mysql_result($rsl,0,'file_type'));
echo $path = stripslashes(mysql_result($rsl,0,'file_path'));
echo $size = mysql_result($rsl,0,'file_size');
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Description: File Transfer");
header("Content-Type: $type");
header("Content-Disposition: attachment; filename=\"".$name."\";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".$size);
@readfile($path);
exit;
}
thank you
Comment