Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head></head>
- <body>
- <p>Result:</p>
- <br />
- <?php
- $data = $_POST['data'];
- /*$decdata = urldecode($data);*/ //Fail function!!!
- $raw = base64_decode($data);
- $img = imagecreatefromstring($raw);
- //Useless Stuff
- /*echo 'Length:' . strlen($raw) . '<br>';
- echo 'Length Dec:' . strlen($decdata) . '<br>';
- $fp = fopen('received.txt', 'w');
- fwrite($fp, $data);
- fclose($fp);*/
- if(imagejpeg($img, 'image.jpg'))
- {
- echo '<p>written</p>';
- }
- else
- {
- echo '<p>failed</p>';
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement