I have a code that gets data(png,jpg and stuff) and save it as a file.
<?php
// requires php5
header('Access-Control-Allow-Origin: *');
define('UPLOAD_DIR', 'static/images/');
$img = $_POST['img'];
$img = str_replace('data:image/png;base64,', '', $img);
$img = str_replace(' ', '+', $img);
$data = base64_decode($img);
$file = UPLOAD_DIR . uniqid() . '.png';
$success = file_put_contents($file, $data);
print $success ? $file : 'Unable to save the file.';
?>[/code:1cocpr8o]
The host is DataServer.Airwavestudio.co.uk/<pathhere> the path here is removed as it can be used to post stuff if gotten hold off.
[img="http://i.gyazo.com/35ad299403b8690b4fd7c39b3414d2a9.png"]
raw: "type='base64'&image=" & URLEncode(RegexReplace(CanvasSnapshot, "data:image/png;base64,", "", ""))
but everytime it gets posted it makes a 0x0 png file.
So what am I doing wrong?