Unwanted blank character
Posted: Sun Nov 15, 2020 2:58 pm
I have a module in which I want to add the ability to save ics file that would look like so:
But instead I get a blank character on the first line:
I tired to narrow down the problem, but I am running out of ideas. So I tried this:
and even the above snippet I call with a hyperlink gives me a 2 byte file containing a space and the dot. Any suggestion what I should look for
Code: Select all
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
LOCATION:123 Fake St\, New York\, NY
DESCRIPTION:This is my description
DTSTART:20201116T090000Z
DTEND:20201116T100000Z
SUMMARY:This is my summary
URL;VALUE=URI:http://example.com
DTSTAMP:20201115T144749Z
UID:5fb13f9575027
END:VEVENT
END:VCALENDAR
Code: Select all
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
LOCATION:123 Fake St\, New York\, NY
DESCRIPTION:This is my description
DTSTART:20201116T090000Z
DTEND:20201116T100000Z
SUMMARY:This is my summary
URL;VALUE=URI:http://example.com
DTSTAMP:20201115T144749Z
UID:5fb13f9575027
END:VEVENT
END:VCALENDAR
Code: Select all
header('Content-Type: text/calendar; charset=UTF-8');
header('Content-Disposition: attachment; filename=ics.ics');echo ".";die();