0
有沒有辦法爲Google文檔查看器提供代理下載的源代碼?如從https://www.url.com/download.php?file=fdg46fgd(隨機下載代碼)。Google文檔查看器外部URL
下載腳本標題是這樣的:
header("Content-Type: " . $mime);
header("Content-Disposition: attachment; filename=\"$name\"");
header("Content-Length: " . $size);
header("Cache-Control: private");
它打印頭後的內容被建立。當您將鏈接輸入到瀏覽器並按預期工作時,此工作正常。我也嘗試使用內聯代替附件,但Google Doc Viewer始終顯示「無法預覽」。文檔查看器的代碼如下所示:
<iframe src="https://docs.google.com/gview?url=https://www.url.com/download.php?file=fdg46fgd&embedded=true" style="width:800px; height:700px;" frameborder="0"></iframe>
我曾嘗試使用不同的文件如PDF,DOCX等
如果我使用一個直接鏈接它會正常顯示,但不使用時下載腳本。我看到人們之前使用基於URL的下載腳本,它似乎適用於他們。這不適用於Google Doc Viewer嗎?有什麼建議麼?任何幫助表示感謝,謝謝!