Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("Access-Control-Allow-Origin: *");
- $image = $_POST['image'];
- $location = "upload/";
- $image_parts = explode(";base64,", $image);
- $image_base64 = base64_decode($image_parts[1]);
- $filename = "screenshot_".uniqid().'.png';
- $file = $location . $filename;
- file_put_contents($file, $image_base64);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement