如何在网络文件夹上调用PDF以在用php生成的iframe中显示它

如何在网络文件夹上调用PDF以在用php生成的iframe中显示它

问题描述:

it's not that complicated as it may sound in title, but here is my code:

<?php
echo '<iframe src="\\servername\pdf\test.pdf"></iframe>';
?>

My error in this case is, that file cannot be found on this server. So I have local network nad I would like to call pdf file on other server. PHP keeps trying to tell me that file doesn't exists on this server. How to switch to another server?

Thank you guys, best!

它并不复杂,因为它可能在标题中发声,但这是我的代码: p> \ n

 &lt;?php 
echo'&lt; iframe src =“\\ servername \ pdf \ test.pdf”&gt;&lt; / iframe&gt;'; 
?&gt; 
  code>   pre> 
 
 

在这种情况下我的错误是,在此服务器上找不到该文件。 所以我有本地网络,我想在其他服务器上调用pdf文件。 PHP一直试图告诉我该服务器上不存在该文件。 如何切换到另一台服务器? p>

谢谢大家, best! p> div>

The way you wrote your path , represents location of current or local storage device. To indicate some remote location you need to specify path along with protocol like 'http://' . For example 'http://location.com/name.pdf' ('http://' - if site is using http protocol)

I know it's a little late but this worked for me :

<iframe src="file://///SERVERNAME/FOLDER/"></iframe>

Yes it is 5 forward slashes