0

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

 <a href="calendar.ics" >Save the Date</a>

This link will open 'calendar.ics' file as plain text in browser (Chrome and Firefox). I want automatic download the .ics file. What can I add to the link tag in order to produce the desired behavior?

I tried webcal://, but it will add a calendar tag in Outlook 2010. It's too much for me.

Any suggestions are appreciated!

CunruiLi
  • 483
  • 1
  • 6
  • 16

1 Answers1

0

I haven't tested it, but i think this should work.

In your .htaccess file:

<filesMatch "\.ics$">
<ifModule mod_headers.c>
Header set Content-type "text/calendar"
</ifModule>
</filesMatch>

or

<filesMatch "\.ics$">
ForceType 'text/calendar'
</filesMatch>

or

AddType text/calendar .ics
  • What is your question? Also, try testing first before posting. -Sorry, I was using the edit feature of SO, and thought this was a question. Sorry for the confusion! – aglassman Sep 17 '12 at 17:51