douzhengnao8265 2019-07-04 11:52
浏览 134

如何通过阅读PDF文件通过JSON对象发送二进制数据?

I'm reading a PDF file content using php fread function. Now I want to post this data through JSON object. So, how can I send this data(content of PDF file)?

I'm using POSTMAN to send pdf file by selecting binary in header option and getting desired result. But how can I achieve this programatically using PHP.

$readfile = fopen("newfile.pdf", "r") or die("Unable to open file!");
echo fread($readfile,filesize("newfile.pdf"));
fclose($readfile);

Using this fread method I'm getting content of 'newfile.pdf'.

I want to send content of 'newfile.pdf' as a JSON object without base64 encode or decode.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度