【发布时间】:2018-11-15 18:00:59
【问题描述】:
您好,我们在本地存储中有很多发票。
他们的发票号码将从 MySQL 数据库中读取,我会生成此发票的链接。
问题是点击会打开一个新窗口,但出现错误,PDF 将无法加载或无法使用 Acrobat Reader 打开。
$invDateOrder = intval($invDateYearArray[1]) . "-" . $invDateYearArray[0];
$pathToInvoice = "X:/ALLGEMEIN/PIXI/Rechnungen/" . $invDateOrder . "/" . $invoiceNumber . ".PDF";
$pathToInvoice = str_replace('/', '\\', $pathToInvoice);
#$pathToInvoice = "file:///".$pathToInvoice;
然后在html部分:
<td><a href="file:/<?= $pathToInvoice ?>" target="_blank"><?= $invoiceNumber ?></a></td>
或
<td><a href="<?= $pathToInvoice ?>" target="_blank"><?= $invoiceNumber ?></a></td>
with file:/ 是一个不可点击的链接
到第二版时,将打开一个带有路径的新窗口,但收到错误消息Firefox does not know how to open this address, because one of the following (x) is not a registered protocol or is not allowed in this context.
我该如何解决?
【问题讨论】: