0

我在服务器中有一个 xml 文件,当用户单击链接时,我试图在浏览器中打开它,所以我设置了如下链接。但它不打开文件。

代码 :

<a title="View XML" href="file://///90.0.0.15/docmgmtandpub/PublishDestinationFolder/index.xml" target="_blank"> Click here </a>

我也尝试使用 javascript,如下所示:

function openFL()
{

    window.open("file:////90.0.0.15/docmgmtandpub/PublishDestinationFolder/index.xml"); 
}

如果我复制路径并尝试直接在浏览器中打开它工作正常但不能通过代码工作。

4

1 回答 1

1

从网页链接到file://URI 充满了安全限制和浏览器如何处理file://URI 的差异——尤其是网络路径。

改为通过 HTTP 提供文件。

于 2013-09-12T07:21:11.200 回答