将PDF上载到媒体档案库后,我试图从站点的页面链接到它。
编辑内容时,我使用超链接工具,然后通过URL输入框选择要链接的PDF。
保存并发布内容后,单击链接将下载PDF,我看不到任何明显的方法可以通过使用当前Media ID Composite提供的功能在浏览器中使此视图变为可查看状态。渲染后,我们得到以下信息:
<a href="/media/64d5b13e-07f2-402f-9b1a-dcfd75d977da/F-KbnQ/CompositeDocumentation.pdf" target="_blank">pdf</a>
有没有一种方法可以不使用媒体ID而是仅使用文件名来引用PDF?
在阅读了PauliØsterø所说的内容之后,我理解了问题所在,但仍然无法想到解决方案。
I can get the PDF to view in the browser by adding ?download=false to the href URL via Developer Tools. But when I try to add ?download=false to the href through Composite, it doesn't take affect and I get the console output: "Resource interpreted as Document but transferred with MIME type application/pdf: "http://c1.wittenauers.com/media/4afb7bc8-f703-469d-a9b2-a524d8f93dcb/ryc7iw/CompositeDocumentation.PDF"."
Here is the network trace that was asked for by Pauli. In the image, I included the bit where I add ?download=false to the URL, in source view, just in case there could be another way to add it.
Edit: URL and headers for the page.
Here is the link to the page that contains the link: http://c1.wittenauers.com/cafe/test
From what you're experiencing, it seems to me that Composite have gotten the MIME type of your uploaded file wrong, and is therefor not correctly telling the browser that this file is a pdf, and the browser doesn't know what to do with it.
This is the exact line in the Source Code which is responsible for this behavior, and the logic is as follows
我在这里进行了快速测试,以表明该行为是预期的。至少在Windows 8的Chrome浏览器中
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句