Forum Moderators: coopster
which offers a file to download video.flv
now my problem is i want to save this file to localhost.
I have tried using
$file1 = file("$link?$QUERY_STRING");
$file1 = @implode("", $file1);
// echo "$file1";
echo "$file1"; gives raw data of file
FLV ��� ���� � 8.....
Now, I want to save it on my local drive so that i can convert it by using FFMPEG
Please help me.
I have tried..
$fh = fopen("testvideo.flv", "w");
fwrite($fh, $file1);
fclose($fh);
but unable to write data into file. File remains blank after execuation of code.
Please help me.
First of all, why read the entire file with "file" then "implode"?
Use file_get_contents. It is the recommended way to read entire contents of file into a string.
$contents = file_get_contents( $path )
or die( " ... " );$fp = fopen( "test.flv", "w" )
or die( " ... " );
if( fwrite( $fp, $contents ) === FALSE ) {
die( " .... " );
}
fclose( $fp );