Показать сообщение отдельно

  #5  
Старый 26.11.2009, 15:19
svesve
Постоянный
Регистрация: 15.06.2007
Сообщений: 527
С нами: 9950786

Репутация: 214


По умолчанию

поидеи поститься файл так

PHP код:
<?php
    $ch 
= curl_init();
    
curl_setopt($ch, CURLOPT_HEADER, 0);
    
curl_setopt($ch, CURLOPT_VERBOSE, 0);
    
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
    
curl_setopt($ch, CURLOPT_URL, $url);
    
curl_setopt($ch, CURLOPT_POST, true);
    
// same as <input type="file" name="file_box">
    
$post = array(
        
"file_box"=>"@/path/to/myfile.jpg",
    );
    
curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
    
$response = curl_exec($ch);
?>
 
Ответить с цитированием