2013-02-06 44 views
2
不工作

我已經使用這個錨下載鏈接在Firefox

<A HREF="/admin/con/image/StudentImportFileTemplate_Create.csv" download="StudentImportFileTemplate_Create.csv">Download</A> 

我已經加入download屬性爲Chrome,但它不支持Firefox的

這在IE工作的罰款和鉻文件越來越下載任何人都可以解釋我如何讓它爲Firefox的工作也。

+0

外貌就像它最近的工作一樣:http://javascript-reverse.tumblr.com/post/37056936789/html5-download-attribute –

+0

'在Firefox 20中,此屬性僅適用於具有相同來源的資源的鏈接(參考文獻:https://developer.mozilla.org/en- US/docs/HTML/Element/a) –

+0

[下載屬性在Firefox中不可用]的可能重複(http://stackoverflow.com/questions/27115748/download-attribute-not-working-in-firefox) –

回答

0

只要這樣寫就可以了。

<a href="/admin/con/image/StudentImportFileTemplate_Create.csv">Download the document</a> 
0

您並不需要使用任何此類屬性來啓動文件下載。

只需使用:

<a href="/admin/con/image/StudentImportFileTemplate_Create.csv">Download</a> 

如果CSV被打開,而不是讓下載並仍想使用的下載屬性,這裏是應該做的正確方法:

http://davidwalsh.name/download-attribute

+0

這是不在鉻工作 – saum22