Php files such as a.coma.rar cannot be accessed in Tianchao. if I write a. php script on an overseas server and access the script path B. coma. php? Urla.coma.rar can be used to download files. could you tell me how to write this a. php file ------ solution ------------------ B. coma. php? How does urla. co php implement proxy file download?
If a.com/a.raris under control, if I write an a.php script and put it on a foreign server, then B .com/a.php? Url = http://a.com/a.rar
The file can be downloaded. how can I write this a. php file?
------ Solution --------------------
B .com/a.php? Url = http://a.com/a.rar
If the file is not large, you can write it like this.
$ Url = isset ($ _ GET ['URL'])? $ _ GET ['URL']: '';
If ($ url ){
$ Content = file_get_contents ($ url );
If ($ content ){
Header ('cache-control: public ');
Header ('content-type: application/octet-stream ');
Header ('content-disposition: attachment; filename = '. basename ($ url ));
Echo $ content;
}
}