A network disk in the compression package RAR format outside the chain has referer detection anti-theft chain, to find PHP, how to deal with

Source: Internet
Author: User
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
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.