daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $data = $_POST['imagebase64'];
  2.  
  3.         list($type, $data) = explode(';', $data);
  4.         list(, $data) = explode(',', $data);
  5.  
  6.  
  7.         $data = base64_decode($data);
  8.  
  9.         $mainFolder = $_SERVER['DOCUMENT_ROOT'];
  10.  
  11.         $subfolder='/users/images/you/';
  12.         $timeMilliseconds = round(microtime(true) * 1000);
  13.  
  14.         $filename = $subfolder.'image64' . $timeMilliseconds . '.png';
  15.        
  16.        
  17.         $fileroot=$mainFolder.$filename;
  18.        
  19.         file_put_contents($fileroot, $data);
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