如何在 PHP 中卷曲 uploadrocket

how to curl uploadrocket in PHP

我正在尝试卷曲 http://uploadrocket.net/?op=checkfiles 的结果并使用 curl 获取文件大小结果。

我尝试了以下方法:

function curl($url,$cookies,$post,$header=1) {
    $ch = @curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, $header);
    if ($cookies) curl_setopt($ch, CURLOPT_COOKIE, $cookies);
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_REFERER,$url); 
    if ($post) {
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
    }
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); 
    curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_TIMEOUT, 30); 
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 20);
    $page = curl_exec( $ch);
    curl_close($ch); 
    return $page;
}

$link = "http://uploadrocket.net/rlajq9dwrxey.htm";

$page = curl('http://uploadrocket.net/?op=checkfiles',"",'list='.urlencode($link).'&process=Check%20URLs');

echo $page;

但它不起作用。

提前致谢

你不能将它复制到你的硬盘上并制作一个文件大小吗?如果你不想要它然后删除它(或复制到临时目录)?

$page = file_get_contents('http://uploadrocket.net/?op=checkfiles/links='.$link.'&process=Check%20URLs');