On Sep 7, 2007, at 12:27 PM, Aparajita Fishman wrote:

It seems the mime type should be text/calendar. Trouble is, if I do a write blob with that content type there is additional text at the top of the file and iCal says the file is invalid.

Use 'clear response buffer' before writing the blob.

I tried that again. Immediately before send blob.
There are 2 carriage returns at the top of the output file and iCal doesn't like it.
I manually removed  the returns and it imported fine.

You manually removed the returns after downloading?

That's what I had to do to get iCal to import the file. iCal would complain if the data did not start at the first char of file.

If I used the commands:
        clear response buffer
        set response buffer($OutBlob_x;"text/calendar")

The resulting file received by visitor has 2 Line Feed chars at the top of the file:

        <LF>
        <LF>
        BEGIN:VCALENDAR
        VERSION:2.0
        X-WR-CALNAME:erc2.leddyconsulting.com
        METHOD:PUBLISH
        ...

if I use the commands:
        clear response buffer
        write blob ($OutBlob_x;"application/calendar")

The resulting file is sent "correctly". It begins simply:

        BEGIN:VCALENDAR
        VERSION:2.0
        X-WR-CALNAME:erc2.leddyconsulting.com
        METHOD:PUBLISH
        ...

With no leading characters.

using: Write Blob($OutBlob_x;"text/calendar") also sends the leading line feeds.

as long as the mime type begins "text/" it seems to include them

Here is the complete text of my code after the blob has been created:

set response header("Content-Disposition";"attachment;filename="+ $HostName_t+".ics")

        set cache control("private")

        clear response buffer
        write blob ($OutBlob_x;"application/calendar")
// set response buffer($OutBlob_x;"text/calendar") // this still put a couple LF's at the top of the file




_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to