stuppid_bot

Untitled

Apr 23rd, 2013
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <?php
  2.  
  3. if ($_SERVER['REQUEST_METHOD'] == 'PUT') {
  4.     $boundary = uniqid();
  5.     $content  = "--$boundary\r\n";
  6.     $content .= "content-disposition: form-data; name=\"photo\"; filename=\"1.jpg\"\r\n";
  7.     $content .= "Content-Type: image/jpeg\r\n";
  8.     $content .= "Content-Transfer-Encoding: binary\r\n\r\n";
  9.     $content .= file_get_contents('php://input') . "\r\n";
  10.     $content .= "--$boundary--\r\n";
  11.  
  12.  
  13.     $context = stream_context_create(array(
  14.         'http' => array(
  15.             'method' => 'POST',
  16.             'header'=> "Content-type: multipart/form-data, boundary=$boundary\r\nContent-Length: " . strlen($content),
  17.             'content' => $content
  18.         )
  19.     ));
  20.  
  21.     echo( file_get_contents($_GET['url'], false, $context) );
  22. }
  23.  
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment