PhpLogLick Posted August 6, 2008 Share Posted August 6, 2008 hey i need help about remote download from another host to mine <?php $file = http://file.com $path = home/user/public_html/ $frw = fopen($file, "r"); $fwr = fopen($path . basename($file), "w"); while(!feof($file)) fwrite($frw, fread($frw, 1), 1); fclose($readf); fclose($fwr); ?> but it seems that doesnt work,any help please? Link to comment https://forums.phpfreaks.com/topic/118460-download-from-remote-server/ Share on other sites More sharing options...
Johntron Posted August 6, 2008 Share Posted August 6, 2008 Well, right off the bat, I notice that you don't have quotes around the values for $file and $path. Link to comment https://forums.phpfreaks.com/topic/118460-download-from-remote-server/#findComment-609776 Share on other sites More sharing options...
DarkWater Posted August 6, 2008 Share Posted August 6, 2008 And you can't fread() through the http:// wrapper, at least as far as I remember. Use the ftp_* functions. Link to comment https://forums.phpfreaks.com/topic/118460-download-from-remote-server/#findComment-609778 Share on other sites More sharing options...
PhpLogLick Posted August 6, 2008 Author Share Posted August 6, 2008 <?php $file = ftp://user:[email protected]/lol.com $path = home/user/public_html/ $frw = fopen($file, "r"); $fwr = fopen($path . basename($file), "w"); while(!feof($file)) fwrite($frw, fread($frw, 1), 1); fclose($readf); fclose($fwr); ?> like this? please help to fix Link to comment https://forums.phpfreaks.com/topic/118460-download-from-remote-server/#findComment-609787 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.