0 Replies Latest reply on Feb 12, 2013 9:16 AM by EBG1103

    Having trouble with iCal

    EBG1103 Level 1

      This code is kind of working in some environments.  I can open it through Safari and iCalendar.  Some other folks cannot.  The file they are receiving has.html appended to the filename.  I can create the same results using a PC if I ask Firefox to open file using outlook.  Saving the file via firefox does not add the .html.  Can anyone see any obvious problems with the code below?  Thanks

       

      <cfsetting enablecfoutputonly="Yes" showdebugoutput="No">

      <cfparam name="url.calid" type="numeric">

      <CFQUERY NAME="GetInfo" datasource="#dsn#">

          select * from tbl_calendar

          where calendar_id =#url.calid#

      </cfquery>

      <CFSET tzinfo = GetTimeZoneInfo()>

       

      <CFIF tzinfo.isDstOn>

          <CFSET timeoffset = tzinfo.utcHourOffset + 1>

      <CFELSE>

          <CFSET timeoffset = tzinfo.utcHourOffset>

      </cfif>

       

      <cfset cal_desc = REReplace(getinfo.calendar_event_description,'#chr(13)#?#chr(10)#','=0D=0A','ALL')>

       

      <cfset CRLF = chr(13)&chr(10)>

       

       

      <CFOUTPUT>

      <cfset vCal = "BEGIN:VCALENDAR#CRLF#">

      <cfset vCal = "#vCal#VERSION:2.0#CRLF#">

      <cfset vCal = "#vCal#PRODID:-//MediaIntranets//#cgi.http_host#//#session.sessionid#/EN#CRLF#">

      <cfset vCal = "#vCal#BEGIN:VEVENT#CRLF#">

      <cfset vCal = "#vCal#UID:#cgi.http_host# - #getinfo.calendar_id##CRLF#">

      <cfset vCal = "#vCal#DTSTAMP:#dateformat(getinfo.calendar_date,"yyyymmdd")#T#timeformat(getinfo.calenda r_start_time,"HHmm")#00#CRLF#">

      <cfset vCal = "#vCal#DTSTART:#dateformat(getinfo.calendar_date,"yyyymmdd")#T#timeformat(getinfo.calenda r_start_time,"HHmm")#00#CRLF#">

      <cfset vCal = "#vCal#DTEND:#dateformat(getinfo.calendar_date,"yyyymmdd")#T#timeformat(getinfo.calendar_ end_time,"HHmm")#00#CRLF#">

      <cfset vCal = "#vCal#LOCATION:#getinfo.calendar_location##CRLF#">

      <cfset vCal = "#vCal#DESCRIPTION;ENCODING=QUOTED-PRINTABLE:#cal_desc##CRLF#">

      <cfset vCal = "#vCal#SUMMARY:#cgi.http_host# - #getinfo.calendar_id##CRLF#">

      <cfset vCal = "#vCal#END:VEVENT#CRLF#">

      <cfset vCal = "#vCal#END:VCALENDAR#CRLF#">

      </cfoutput>

      <CFHEADER NAME="Content-Disposition" VALUE="attachment; filename=event.ics">

      <CFCONTENT  reset="Yes">

      <cfoutput>#trim(vCal)#</cfoutput>

      <cfsetting enablecfoutputonly="No" showdebugoutput="No">