drmqzb5063 2019-07-28 16:43
浏览 45

在PHP CodeIgniter中读取EXIF

I'm making an API in PHP using CodeIgniter. I need to save the data and the image given. Here's the API Documentation : enter image description here

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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 oracle集群安装出bug
    • ¥15 关于#python#的问题:自动化测试
    • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
    • ¥15 教务系统账号被盗号如何追溯设备
    • ¥20 delta降尺度方法,未来数据怎么降尺度
    • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
    • ¥15 再不同版本的系统上,TCP传输速度不一致
    • ¥15 高德地图2.0 版本点聚合中Marker的位置无法实时更新,如何解决呢?
    • ¥15 DIFY API Endpoint 问题。
    • ¥20 sub地址DHCP问题