Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Show the image
- echo '<img src="'.$_POST['img_val'].'" />';
- //Get the base-64 string from data
- $filteredData=substr($_POST['img_val'], strpos($_POST['img_val'], ",")+1);
- //Decode the string
- $unencodedData=base64_decode($filteredData);
- //Save the image
- file_put_contents('/images/image.png', $unencodedData);
- ?>
- <div id="target">
- <input id="fileup" name="fileup" type="file" style="display:none;">
- <div id="container" class="container"></div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement