I have not tried that but I will, here's the php file that will accept the data ...
if(!isset($_REQUEST['sender_email']) || !isset($_REQUEST['ext']) ){
echo "result=fail&errorMsg=invalid request";
exit;
} else {
$headers = 'From:
hello@example.com' . "\r\n" .
'Reply-To:
hello@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$email = $_REQUEST['sender_email'];
$msg = "";
foreach ($_REQUEST as $k => $v) {
$msg .= " $k = $v\n";
}
mail($email, "Microphone Check", $msg, $headers);
echo "result=success&email=" . $email;
}
if(isset($_REQUEST['postcard'])){
$ext = $_REQUEST['ext'];
// define the image
$file = $_REQUEST['postcard']; //base64_decode($_REQUEST['postcard']);
// define the file name
$filename = time();
// define destination path to image
$destPath = "../postcards/" . $filename . "." . $ext;
// save the image
try {
@file_put_contents($destPath, $file);
} catch (Exception $ex) {
echo "&result=failed&errorMsg=" . urlencode($ex);
}
}