2013-08-12 10:41


  • iframe
  • networking
  • file
  • php
  • directory

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

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!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • dongzhihong3940 dongzhihong3940 8年前

    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)

    点赞 评论 复制链接分享
  • douan6931 douan6931 2年前

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

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

    Yes it is 5 forward slashes

    点赞 评论 复制链接分享