Skip to main content
Participant
April 15, 2010
Question

ColdFusion 8 adding unwanted text when calling a function.

  • April 15, 2010
  • 1 reply
  • 707 views

Hi,

I'm trying to create an ics file by calling a function but ColdFusion 8 is adding extra code "

<link rel="Shortcut Icon" href="/favicon.ico">

" on the beginning of the ics file. Can anybody show me to to avoid Coldfusion 8 adding this extra code?

here's the sample code that I am trying.

<cfscript>
stEvent = StructNew();
stEvent.description = "This can come from a file or other variable";
stEvent.subject = "A vCal created with the vCal UDF";
stEvent.location = "Chicago, IL";
stEvent.startTime = '#Dateformat(Now(), 'mmmm dd, yyyy') & " " & Timeformat(Now(), 'hh:mm tt')#'; //dateObj or timestamp in GMT
stEvent.endTime = '#Dateformat(Now(), 'mmmm dd, yyyy') & " " & Timeformat(Now(), 'hh:mm tt')#'; // dateObj or timestamp in GMT
stEvent.priority = 1;
vCalOutput = iCal(stEvent);
</cfscript>

<cfcontent type="text/calendar" reset="Yes">
   <cfheader name="Content-Disposition" value="inline; filename=newAppointment.vcs"><cfoutput>#iCal(stEvent)#</cfoutput>

This is the output file that I am getting that makes it invalid calendar file due to extra code that being generated.

<link rel="Shortcut Icon" href="/favicon.ico">BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
CLASS:PUBLIC
CREATED:20100415T105337Z
DESCRIPTION;ENCODING=QUOTED-PRINTABLE:This can come from a file or other variable
DTEND:20100415T105300Z
DTSTAMP:20100415T105337Z
DTSTART:20100415T105300Z
LOCATION:Chicago, IL
PRIORITY:1
SEQUENCE:0
SUMMARY;ENCODING=QUOTED-PRINTABLE:A vCal created with the vCal UDF
TRANSP:OPAQUE
UID:01F5FB8D-5056-B053-A9646F5CFC7DB1FB
TRANSP:OPAQUE
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-IMPORTANCE:2
BEGIN:VALARM
TRIGGER:-PT30M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR
    This topic has been closed for replies.

    1 reply

    Inspiring
    April 15, 2010

    I'd bet BKBK's right arm that it's not CF8 doing that, but rather think it's perhaps something in your code doing it.  Do you have something like that in your Application.cfm file or onRequestStart() / onRequest() methods?

    I'd do a search of your source code for that string...

    --

    Adam

    matt_xtrAuthor
    Participant
    April 15, 2010

    Thanks!

    I found in the Application.cfm that runs <cfhtmlhead> tag that ads the "favicon.ico" in each page request. I asked the senior developer but they couldn't remember anymore as this application is 10 years old now .