Hey, ich versuche via PHP Files auf load.to zu schieben, bekomme aber immer nur ein "WARNING: Could not get hash sum of file." zurück.

Ich hab hier folgenden Code.

PHP-Code:
function request($url$data = array(), $enableCookies true$redirect false$file null$fileFieldName null) {

  
$ch curl_init($url);

  
$userAgent  'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0';

  if(
$enableCookies) {
    
curl_setopt($chCURLOPT_COOKIEFILEcookie($url));
    
curl_setopt($chCURLOPT_COOKIEJAR,  cookie($url));
  }

  
curl_setopt($chCURLOPT_USERAGENT,  $userAgent); // empty user agents probably not accepted
  
curl_setopt($chCURLOPT_RETURNTRANSFER1);
  
curl_setopt($chCURLOPT_FOLLOWLOCATION$redirect);
  
curl_setopt($chCURLOPT_AUTOREFERER,    1); // enable this - they check referer on POST
  
curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);

  if(
$file) {

    if(!
file_exists($file))
    {
      throw new 
Exception('File not found');
    }

    
$curl_file = new CurlFile(realpath($file), mime_type($file), basename($file));
    
    
$field = ($fileFieldName $fileFieldName 'file');
    
$data[$field] = $curl_file;

  }

  if(
count($data)) {
    
curl_setopt($chCURLOPT_POSTcount($data));
    
curl_setopt($chCURLOPT_POSTFIELDS$data);
  }

  
$response curl_exec($ch);

  
$result = array(
    
'contents' => $response,
    
'request' => array(
      
'statusCode' => curl_getinfo($chCURLINFO_HTTP_CODE),
      
'info' => curl_getinfo($ch)
    )
  );

  
curl_close($ch);

  return 
$result;

}

function 
cookie($url) {
   return 
'cookies/'.parse_url($urlPHP_URL_HOST).'.cookie';
 }

function 
mime_type($file){

   
$finfo finfo_open(FILEINFO_MIME_TYPE);
   
$mime_type finfo_file($finforealpath($file));
   
finfo_close($finfo);

   return 
$mime_type;

 } 
Das ist dann die Upload Funktion

PHP-Code:
function loadTo_upload($file$username null$password null){
    
    if(!
file_exists($file))
    {
        throw new 
Exception('File not found');
    }
    
    
// wir holen uns die upload url
    
$page request('https://www.load.to')['contents']; 
    if(!
preg_match("~form name=\"form_upload\" method=\"post\" enctype=\"multipart/form-data\" action=\"(.*?)\"~"$page$matches))
    {
        return 
false;
    }
    
    
// link zur voll url upgraden
    
$upload_url preg_replace('#\/\/s(.*)#''http://s$1'$matches[1]);

    
var_dump($upload_url);
    
// upload!!!
    
$data['email'] = '';
    
$data['filecomment'] = '';
    
$data['imbedded_progress_bar'] = 1;
    
$data['upload_range'] = 1;
    
    
$page request($upload_url$datafalsetrue$file'upfile_0')['contents'];
    echo 
$page;
    
// form name="form_upload" method="post" enctype="multipart/form-data" action="//s1.load.to/cgi-bin/loadto_upload.pl?tmp_sid=dfc60736beefd7d9db93fa743b0d8754&config_file=loadto"




Ich denke das soweit alles korrekt ist, aber wie gesagt es funktioniert nicht. Wenn ich mir Chrome Debug angucke kommt die loadto_upload.pl gar nicht vor, im Quelltext steht sie aber.

Hat jemand ne Idee? Wäre sehr dankbar.

lg