ZuriJAckshoT Posted April 18, 2007 Share Posted April 18, 2007 Dear All, I know how to make a http request with php using CURL extention. My question is "Can I make a http download request to a server from my php script and save it?" Any Advice Is Valued. Best Regards, Zuri JAckshoT Link to comment https://forums.phpfreaks.com/topic/47506-solved-how-to-download-a-file-with-php/ Share on other sites More sharing options...
genericnumber1 Posted April 18, 2007 Share Posted April 18, 2007 You don't really have to even use curl for this, you could use file_get_contents() or fopen(). It is definitely possible to do this in curl, it's just a bit overkill. Link to comment https://forums.phpfreaks.com/topic/47506-solved-how-to-download-a-file-with-php/#findComment-231863 Share on other sites More sharing options...
ZuriJAckshoT Posted April 18, 2007 Author Share Posted April 18, 2007 You don't really have to even use curl for this, you could use file_get_contents() or fopen(). It is definitely possible to do this in curl, it's just a bit overkill. Thanks you Can I download binary files such as picture and movie files with those functions? Link to comment https://forums.phpfreaks.com/topic/47506-solved-how-to-download-a-file-with-php/#findComment-231866 Share on other sites More sharing options...
genericnumber1 Posted April 18, 2007 Share Posted April 18, 2007 Yes, you may have to worry with big files though and not load them into memory all at once. You could stream it to save a huge memory hit all at once (but increase execution time), there is a good example of this here... http://www.php.net/manual/en/function.fread.php (the bottom example that uses feof.) Link to comment https://forums.phpfreaks.com/topic/47506-solved-how-to-download-a-file-with-php/#findComment-231869 Share on other sites More sharing options...
ZuriJAckshoT Posted April 18, 2007 Author Share Posted April 18, 2007 Yes, Thank you very much. I think that's explains pretty much I need to know about. I think this topic is solved. :) Link to comment https://forums.phpfreaks.com/topic/47506-solved-how-to-download-a-file-with-php/#findComment-231872 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.