可能重複:
How to force a pdf download automatically?如何強制PDF下載初學者
我檢查了其他論壇,但我不明白他們在說什麼。我檢查這個鏈接,人們似乎得到了解決方案:
http://css-tricks.com/snippets/htaccess/force-files-to-download-not-open-in-browser/
我想要做的這是用於下載PDF做一個按鈕,該文件是太大,在網上看到它。所以我想要那個按鈕來強制瀏覽器下載文件。詢問或不詢問用戶。會有不同的PDF名稱文件,所以我需要使用各種PDF文件的PDF格式下載此按鈕。
我檢查過不同的網站,它似乎可以使用htaccess完成,但我真的不知道如何做到這一點。有人可以幫助告訴我怎樣才能做到這一點!?!?!有沒有簡單的方法通過CSS/HTML?
我一直堅持了很長一段時間這樣一個小細節。
我的代碼很簡單:
<div class="Container for icons">
<a href="hugefile.pdf" alt=""><img href="icon.png" alt=""/>
</div>
可能有人給我的手在這一個?
使用PHP更有效。 – Homework 2012-08-16 15:50:26