So, using
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "hash=$hash");
should work.
You are right. Works perfectly!
thx !!! but really weird, this arry-method has been working since 2 years....
they must have changed their pages recently....
the most ugly thing is... submit does not work either, but this need multiform data ! so i submit now by email....
-- gerhard
this code has been working till this morning since 2 years....
now i fixed it: this made my day... curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
<?php
function do_virustotal($url,$xid) {
$use_proxy=false;
$ret="";
$uploadfile="/var/www/clean-mx/virusesevidence/output.$xid.txt";
$ch = curl_init("http://www.virustotal.com/vt/de/recepcion");
curl_setopt($ch, CURLOPT_POSTFIELDS,
array(
'distribuir'=>'1',
'envioseguro'=>'0',
'archivo'=>"@$uploadfile"
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER,true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,30);
curl_setopt($ch, CURLOPT_TIMEOUT,60);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)');
if ($use_proxy == TRUE)
{
curl_setopt($ch, CURLOPT_PROXY,'62.67.194.35');
curl_setopt($ch, CURLOPT_PROXYPORT, 3128);
#curl_setopt($ch, CURLOPT_PROXYUSERPWD , 'myuser:mypwd');
curl_setopt($ch, CURLOPT_PROXYTYPE , CURLPROXY_HTTP);
#curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
}
$postResult = curl_exec($ch);
#print_r($postResult);
curl_close($ch);
$serverantwort=explode("\n",$postResult);
foreach($serverantwort as $resp){
if (strpos($resp,"Location: ")===false) {
} else {
$ret1=trim(substr($resp,strpos($resp,"Location: ")+10));
$ret2=explode("\r",$ret1);
$ret="http://www.virustotal.com".$ret2[0];
print("$xid\tsubmitted\t$ret\n");
break;
}
}
return $ret;
}
?>