I'm making an API in PHP using CodeIgniter. I need to save the data and the image given. Here's the API Documentation :
I already got the data using $_POST['data']. But for the image I can't get it with $_FILES. I know images should be retrieved with $_FILES. But the client somehow don't put it as a file. He put the binary data of the file in a POST Body instead. Instead of sending me the image, he sent me this data.
This is my code for getting the data.
$data = json_decode($_POST['data']);
$image = $_POST['image'];
The binary data starts with this snippet
ExifMM*n%<i2vRedmi 32019:07:24 20:10:31Xiaomi
!5'|A'4557864557862019:07:24 20:10:31455786fqx2019:07:24200/100
JFIFC
I think this is an EXIF file. Can anybody confirm it? I'm not really familiar with file type. I already tried using exif_read_data, but error shows file not supported.
Is there anyway of getting an image from such file? If I can get the data using EXIF then why does PHP said the file is not supported. Any help would be greatly appreciated.