I want HTML link to .ics file to open in calendar app when clicked, currently opens file as plain text. Suggestions?

后端 未结 2 851
半阙折子戏
半阙折子戏 2020-12-08 00:57

I am linking to an .ics file exported from Apple iCal in an HTML web page.


This link will open

相关标签:
2条回答
  • 2020-12-08 01:48

    If your calendar file is not static, you should consider the webcal:// protocol which Outlook and iCal will handle:

    <a href="webcal://domain.com/path/calendar.ics">
    

    Rather than downloading a one-time file, the attendees' calendar programs will periodically poll for updates to your calendar. This will let their calendars add new events and update changed events to match your published list.

    0 讨论(0)
  • 2020-12-08 01:49

    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.

    add this to your htaccess file:

    AddType text/calendar .ics
    
    0 讨论(0)
提交回复
热议问题