satal keto Posted March 12, 2007 Share Posted March 12, 2007 I have been trying to find out how to get a PHP script to download a file from another server (via HTTP not FTP) and save it to the server that is running the PHP script. I have been able to find out how to upload a file from say my computer and how to download a file from the server to my computer but not from one server to another. I was wondering whether anyone has any ideas on how I would be able to do this or somewhere which has information which would help me to figure this out Thanks for any help in advance Satal Keto Link to comment https://forums.phpfreaks.com/topic/42342-download-file-to-server/ Share on other sites More sharing options...
Wuhtzu Posted March 12, 2007 Share Posted March 12, 2007 What type of files are we talking about? Because if it happens to be either images or text there is specific ways of dealing with exactly those to types of files which wont work for copying files generally Link to comment https://forums.phpfreaks.com/topic/42342-download-file-to-server/#findComment-205397 Share on other sites More sharing options...
satal keto Posted March 12, 2007 Author Share Posted March 12, 2007 no not images or txt files. Zip files rar files exe files really Link to comment https://forums.phpfreaks.com/topic/42342-download-file-to-server/#findComment-205399 Share on other sites More sharing options...
trq Posted March 12, 2007 Share Posted March 12, 2007 If your on Linux one way would be to use wget. eg; <?php exec('wget http://domain.com/file.rar'); ?> Link to comment https://forums.phpfreaks.com/topic/42342-download-file-to-server/#findComment-205400 Share on other sites More sharing options...
Wuhtzu Posted March 12, 2007 Share Posted March 12, 2007 Just checked the manual... Why not use: http://no.php.net/copy Link to comment https://forums.phpfreaks.com/topic/42342-download-file-to-server/#findComment-205403 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.