php script:
$contentType = isset($_SERVER["CONTENT_TYPE"]) ? trim($_SERVER["CONTENT_TYPE"]) : '';
if ($contentType === "application/json") {
//Receive the RAW post data.
$content = trim(file_get_contents("php://input"));
$decoded = json_decode($content, true);
//If json_decode failed, the JSON is invalid.
if(! is_array($decoded)) {
echo "Invalid json";
} else {
$image=$decoded['image'];
}
}
As you can see in the above given picture, I just want to upload the image file name and not its base64 encoded string. How do I do that?