問題描述
我正在鏈接到 HTML 網頁中從 Apple iCal 導出的 .ics
文件.
I am linking to an .ics
file exported from Apple iCal in an HTML web page.
<a href="calendar.ics">
此鏈接將在我的瀏覽器 (Chrome) 中以純文本格式打開 calendar.ics
文件.我想在 Outlook 或 iCal 或其他日歷應用程序中自動打開.我可以向鏈接標簽添加什么以產生所需的行為?修改 .ics
文件上的 HTTP 標頭怎么樣?
This link will open the calendar.ics
file as plain text in my browser (Chrome). I want automatic opening in Outlook or iCal or other calendar apps. What can I add to the link tag in order to produce the desired behavior? What about modifying the HTTP headers on .ics
files?
歡迎提出任何建議!
推薦答案
如果你的網站像我一樣是在 Linux 上構建的,你可以簡單地在你的 htaccess 文件中添加一行,讓它作為下載而不是文本頁面打開.
If your site is built on Linux like mine you can simply add a line to your htaccess file to make it open as a download instead of a text page.
將此添加到您的 htaccess 文件中:
add this to your htaccess file:
AddType text/calendar .ics
這篇關于我希望單擊時在日歷應用程序中打開指向 .ics 文件的 HTML 鏈接,當前以純文本形式打開文件.建議?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!