A network disk in the compression package RAR format outside the chain has referer detection anti-theft chain, beg PHP
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.
------Solution--------------------
$url = '/A connection address url.rar format ';
$ch = Curl_init (); Initialization
curl_setopt ($ch, Curlopt_url, $url); The page you want to visit
curl_setopt ($ch, Curlopt_referer, ' an unsolicited URL '); Forge an unsolicited page
curl_setopt ($ch, Curlopt_header, 1); To read back the HTTP header
curl_setopt ($ch, Curlopt_writefunction, ' func '); Listen for the returned data
Curl_exec ($ch); Perform
function func ($ch, $str) {
Static $s = ' @ ';
if ($s) {
$s = trim ($STR);
if ($s) header ($s); If it is a header message, the corresponding header is sent
}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