The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
Hi guys... good day to you all...
for days i've been trying to figure out how to implement the PHP codes to ASP codes.
in HTML file
and the html calls on this save.php file
is it possible for the save.php file implemented in ASP codes? if yes, what should i be looking into to make it work? can you guys show me some examples to implement it....
thanks...
for days i've been trying to figure out how to implement the PHP codes to ASP codes.
in HTML file
Code:
function saveImage(){
var data = myCanvas.toDataURL();
var request = new XMLHttpRequest();
request.open('POST', 'save.php', true);
request.setRequestHeader('Content-type','application/x-www-form-urlencoded');
request.send('img='+data);
}and the html calls on this save.php file
Code:
define('UPLOAD_DIR', '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.';is it possible for the save.php file implemented in ASP codes? if yes, what should i be looking into to make it work? can you guys show me some examples to implement it....
thanks...