I am trying to get through an API, a live open access pdf file, and then download that file to my server. However the PDF file does not end with a ".pdf" extension but is encapsulated in a more complexe url: http://aip.scitation.org/doi/pdf/10.1063/1.4996175 A web browser would simply ask to open or save it as a PDF file, whereas my script cannot translate it as such. How can I make my PHP script recognize this url as a PDF file? Thanks in advance. Olivier
dongyaoxiu6244
2017-10-27 06:42 浏览 891
已采纳
PHP - 从链接下载pdf文件并保存在本地文件夹中
图片转代码服务由CSDN问答提供 功能建议
我正在尝试通过API,实时开放访问pdf文件,然后将该文件下载到我的服务器 。 但是,PDF文件不以“.pdf”扩展名结尾,而是封装在更复杂的网址中: http://aip.scitation.org/doi/pdf/10.1063/1.4996175 网络浏览器只是要求打开或将其保存为PDF文件,而我的脚本无法翻译 因此。 如何让我的PHP脚本将此URL识别为PDF文件? 提前谢谢。 Olivier </ p> </ div>
- 写回答
- 好问题 提建议
- 追加酬金
- 关注问题
- 分享
- 邀请回答