SgtSlaughter Posted January 4, 2007 Share Posted January 4, 2007 Hi, I was wondering how it would be possible to download a file (a direct link) and save it to a directory using a php script. I've never done anything quite like this before but, taking a wild stab, I'm guessing I would open a socket to the file and write it locally? Or is there a better way?Thanks in advance Link to comment https://forums.phpfreaks.com/topic/32885-downloading-to-server/ Share on other sites More sharing options...
SgtSlaughter Posted January 5, 2007 Author Share Posted January 5, 2007 *bump*Anyone?Please. Link to comment https://forums.phpfreaks.com/topic/32885-downloading-to-server/#findComment-153220 Share on other sites More sharing options...
trq Posted January 5, 2007 Share Posted January 5, 2007 What kind of server? If your using Linux, it may be easier (if its available) to just use wget. Link to comment https://forums.phpfreaks.com/topic/32885-downloading-to-server/#findComment-153222 Share on other sites More sharing options...
trq Posted January 5, 2007 Share Posted January 5, 2007 What kind of file actually? Link to comment https://forums.phpfreaks.com/topic/32885-downloading-to-server/#findComment-153223 Share on other sites More sharing options...
SgtSlaughter Posted January 5, 2007 Author Share Posted January 5, 2007 Unfortunately I don't have SSH access. It is linux though.I'd like to be able to download all file types, although mostly .zip and .rar archives.Thanks! :) Link to comment https://forums.phpfreaks.com/topic/32885-downloading-to-server/#findComment-153498 Share on other sites More sharing options...
trq Posted January 7, 2007 Share Posted January 7, 2007 Even without shell access you may be able to use [url=http://php.net/shell_exec]shell_exec[/url] to run wget. Link to comment https://forums.phpfreaks.com/topic/32885-downloading-to-server/#findComment-155030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.