SHARE
TWEET

Untitled

a guest Jan 28th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $key = '9VLNIsCS+BzH6wbu1ZvBlHVQbJq5lGw0';
  3. $fp = stream_socket_client('tcp://localhost:30033', $errno, $errstr, 30, STREAM_CLIENT_CONNECT);
  4. if (!$fp) {
  5.     die('connection failed');
  6. }
  7.  
  8. fwrite($fp, $key);
  9. $data = file_get_contents('test.png');
  10.  
  11. $size = strlen($data);
  12. $seek = 0;
  13. $pack = 4096;
  14.  
  15. for (; $seek < $size;) {
  16.     $rest = $size-$seek;
  17.     $pack = $rest < $pack ? $rest : $pack;
  18.     $buff = substr($data, $seek, $pack);
  19.     $seek = $seek+$pack;
  20.    
  21.     fwrite($fp, $buff);
  22. }
  23.  
  24. fclose($fp);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top