Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <?php
  2.  
  3. //Show the image
  4. echo '<img src="'.$_POST['img_val'].'" />';
  5.  
  6. //Get the base-64 string from data
  7. $filteredData=substr($_POST['img_val'], strpos($_POST['img_val'], ",")+1);
  8.  
  9. //Decode the string
  10. $unencodedData=base64_decode($filteredData);
  11.  
  12. //Save the image
  13. file_put_contents('/images/image.png', $unencodedData);
  14. ?>
  15.  
  16. <div id="target">
  17. <input id="fileup" name="fileup" type="file" style="display:none;">
  18. <div id="container" class="container"></div>
  19. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement