Advertisement
Guest User

Untitled

a guest
Jul 1st, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  1. <?php
  2. header("Access-Control-Allow-Origin: *");
  3. $image = $_POST['image'];
  4.  
  5. $location = "upload/";
  6.  
  7. $image_parts = explode(";base64,", $image);
  8.  
  9. $image_base64 = base64_decode($image_parts[1]);
  10.  
  11. $filename = "screenshot_".uniqid().'.png';
  12.  
  13. $file = $location . $filename;
  14.  
  15. file_put_contents($file, $image_base64);
  16. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement