mapleleaf Posted July 8, 2009 Share Posted July 8, 2009 I have an mp3 file I need to grab from site every few days. It is a 30mb file and would be much easier if I didn't need to download and then upload to my site. Any one know of a way I can grab the url of the site and get it to download to the server so i can be cut out of the loop? Link to comment https://forums.phpfreaks.com/topic/165228-save-a-file-directly-to-the-server/ Share on other sites More sharing options...
corbin Posted July 8, 2009 Share Posted July 8, 2009 If HTTP wrappers are enabled: file_get_contents If not: fsockopen Link to comment https://forums.phpfreaks.com/topic/165228-save-a-file-directly-to-the-server/#findComment-871298 Share on other sites More sharing options...
rhodesa Posted July 8, 2009 Share Posted July 8, 2009 yup, file_get_contents() should work...as well as copy() you will also want to use: set_time_limit(0); to keep the script from timing out Link to comment https://forums.phpfreaks.com/topic/165228-save-a-file-directly-to-the-server/#findComment-871303 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.