Sun Java System Calendar Server 6.3 WCAP Developer's Guide

Example

The following POST message imports the attached iCalendar file to the calendar jdoe using the import command. The session ID is required:

POST /import.wcap?id=t95qm0n0es3bo35r
  &calid=jdoe&dtstart=0&dtend=0
Content-type: multipart/form-data;
boundary=---------------------------33111928916708
 Content-Length: 679
 -----------------------------------33111928916708
 Content-Disposition: form-data; name="Upload";
filename="C:\\TEMP\\ical1.ics"
 BEGIN:VCALENDAR
 BEGIN:VEVENT
 DTSTART:20020105T100000Z
DTEND:20020105T110000Z
 DTSTAMP:20010104T120020Z
 CREATED:20010105T110000Z
 LAST-MODIFIED:20010104T120020Z
 SUMMARY:Weekly QA Meeting
 UID:random-uid001
 END:VEVENT
 BEGIN:VEVENT
 DTSTART:20020106T100000
 DTEND:20020106T110000
DTSTAMP:20010104T120020
 CREATED:20010105T110000Z
 LAST-MODIFIED:20010104T120020Z
 SUMMARY:Weekly QA Meeting 2
 UID:random-uid002
 END:VEVENT
 END:VCALENDAR
---------------------------------33111928916708--

The following HTML form creates such a POST message, attaching a file that the user specifies:

<FORM METHOD=POST ENCTYPE="multipart/form-data"
ACTION="http://calendarserver:12345/import.wcap
        ?id=t95qm0n0es3bo35r
        &calid=jdoe
        &dtstart=0
        &dtend=0
        &content-in=text/calendar"\>
<ol\>
<li\>file to import:<input type="file" accept="text" name="Upload"\>
</li\>
 <li\>Press Import Now:<input type="submit" value="Import Now"\></li\>
 </ol\>
 </FORM\>