stuppid_bot

Untitled

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