Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.5k views
in Technique[技术] by (71.8m points)

后台返回的pdf文件流不完全

后台是C++写的,采用mmap()文件映射把文件流放在返回的http data中,但是发现返回的文件流不完全,请问是怎么回事?
image.png后台返回的文件流
image.png把原文件用记事本打开的文件流
image.png后台的核心函数
image.png前端的核心函数
请问有大佬知道是为什么吗,pdf一直是损坏的


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

pdf流要采用二进制数据方式发送吧,如果采用文本发送,则访问到文本空字符就会断掉,可能是这个原因。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...