cyfer65 Posted July 26, 2011 Share Posted July 26, 2011 is it possible to get a remote file from another site and download it through my site like a proxy, saving it to my computer..?what does the php code look like for this..? Link to comment Share on other sites More sharing options...
Ingolme Posted July 26, 2011 Share Posted July 26, 2011 Yes, it's possible. Sending the right Content-Type and Content-Disposition headers and using file_get_contents to load the file from the other site. If fopen doesn't have permission to perform remote requests you can use cURL to load the file contents instead. Link to comment Share on other sites More sharing options...
cyfer65 Posted July 26, 2011 Author Share Posted July 26, 2011 which way is better..?any examples..? Link to comment Share on other sites More sharing options...
Ingolme Posted July 26, 2011 Share Posted July 26, 2011 Here's an example of how to make a download dialog for some content:http://www.php.net/manual/en/function.head...header-examplesThis example shows how to get contents from a remote URL:http://php.net/file_get_contents#example-1972This example shows how use the cURL library:http://www.php.net/manual/en/curl.examples-basic.php Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.