Hi i'm sending encoded base image string from android side and in server side i'm decoding the encoded image string and storing to folder, while saving to database i'm storing .JPG format. But the issue is if i upload .PNG image from android side it is storing in .JPG format but image is not visible in server side folder, and if i upload .JPG format it is visible in server side folder. Please help me out this problem.
PHP Code
if(isset($_REQUEST['image1']))
{
$profile_picture = $_REQUEST['image1'];
$target_path = "./upload/"."file"."_".time().".jpg";
// **I want store multiple file forame** //
$upload_img= "file"."_".time().".jpg";
file_put_contents($target_path, base64_decode($profile_picture));
}
else
{
$upload_img = "image.png";
}