A network disk in the ZIP package rar referer detection chain, I want to put it on the blog, let people directly can download, how to forge the route, and then you can open to download the file in this RAR format, PHP code
I've been messing around with code http://bbs.csdn.net/topics/390842920, not feeling good.
Reply to discussion (solution)
Forged Referer
Forged Referer
Request Code
$url = '/A connection address url.rar format '; $ch = Curl_init (); Initialize curl_setopt ($ch, Curlopt_url, $url); The page you want to visit curl_setopt ($ch, Curlopt_referer, ' One of the antecedents URL '); Forge the Antecedents page curl_setopt ($ch, Curlopt_header, 1); To read back the HTTP header curl_setopt ($ch, Curlopt_writefunction, ' func '); Monitor the returned data curl_exec ($ch); Execute function func ($ch, $str) { static $s = ' @ '; if ($s) { $s = trim ($str); if ($s) header ($s); If it is the header information, send the corresponding head }else echo $str; Otherwise send data return strlen ($STR);}
Since the other side provides the download, then the relevant information has been provided, including the file name and length