inversesoft123 Posted January 16, 2010 Share Posted January 16, 2010 I am having a problem to read file from remote url. at this stage I have successfully grabbed a video from YouTube and link which is generated is. $link = http://v14.lscache2.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor&fexp=901421%2C900033%2C903105&algorithm=throttle-factor&itag=5&ipbits=0&burst=40&sver=3&expire=1263679200&key=yt1&signature=76BE713D53D80C026AB6BDB2B83C82FF545B56B8.8626535B14E415A063E18531C0DEFFE78D4E2678&factor=1.25&id=30b46ae0eadc46df 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������� � onMetaData ��� � duration�@Aó33333� starttime���������� totalduration�@Aó33333� width�@y������� height�@l@������ videodatarate�@r ¬ë ®Ó� audiodatarate�@M”}¹óÓ–� totaldatarate�@vB˜'’.Ž� framerate�@>������� bytelength�A8h®����� canseekontime � sourcedata � B4A7D0108HH�������.......... and grabbed file data. Now, I want to save it on my local drive so that i can convert it by using FFMPEG Please help me. Link to comment https://forums.phpfreaks.com/topic/188689-catching-a-proper-file-from-remote-server-plz-help/ Share on other sites More sharing options...
wildteen88 Posted January 16, 2010 Share Posted January 16, 2010 You can use, fopen and fwrite to create/write the file. Link to comment https://forums.phpfreaks.com/topic/188689-catching-a-proper-file-from-remote-server-plz-help/#findComment-996108 Share on other sites More sharing options...
inversesoft123 Posted January 16, 2010 Author Share Posted January 16, 2010 $fh = fopen(testvideo.flv, "w"); fwrite($fh, $file1); fclose($fh); Tried this but no success. Link to comment https://forums.phpfreaks.com/topic/188689-catching-a-proper-file-from-remote-server-plz-help/#findComment-996110 Share on other sites More sharing options...
wildteen88 Posted January 16, 2010 Share Posted January 16, 2010 The filename needs be wrapped with in quotes. Link to comment https://forums.phpfreaks.com/topic/188689-catching-a-proper-file-from-remote-server-plz-help/#findComment-996111 Share on other sites More sharing options...
inversesoft123 Posted January 16, 2010 Author Share Posted January 16, 2010 $fh = fopen("testvideo.flv", "w"); fwrite($fh, $file1); fclose($fh); yeah but unable to write data into file. File remains blank after execuation of code. Link to comment https://forums.phpfreaks.com/topic/188689-catching-a-proper-file-from-remote-server-plz-help/#findComment-996115 Share on other sites More sharing options...
inversesoft123 Posted January 17, 2010 Author Share Posted January 17, 2010 Still waiting 4 reply .,, unsolved... Link to comment https://forums.phpfreaks.com/topic/188689-catching-a-proper-file-from-remote-server-plz-help/#findComment-996377 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.