title: ICalendar transferred with text/calendar mime type
body: <br />
  back again with another question related to the ics format and its browser specific management.<br />
  I wrote a server, if you care a RestFUL server generated with Spring 3.2, which returns a String directly to the calling client (here, for client, I mean a browser). The signature of my method is like
  <pre><code>@RequestMapping(value=&quot;/path_and_params&quot;, method = RequestMethod.GET)
  public ResponseEntity&lt;String&gt; myMethod (@PathVariable(&quot;first&quot;) long first, @PathVariable(&quot;second&quot;) String second)
  </code></pre>
  <p>Somewhere in <code>myMethod</code> I tweak the response with</p>
  <pre><code>HttpHeaders headers = new HttpHeaders();
  headers.add(&quot;Content-Type&quot;, &quot;text/calendar; charset=utf-8&quot;);
  headers.add(&quot;Content-Disposition&quot;, &quot;inline;filename=calendar.ics&quot;);
  </code></pre>
  <p>so that in the end what I return is</p>
  <pre><code>return new ResponseEntity&lt;String&gt; ( icsAsString, headers, HttpStatus.CREATED );
  </code></pre>
  <p>My desire is to have the browser to automatically create a file named <code>calendar.ics</code> from <code>String icsAsString</code> (note that <code>icsAsString</code> is created using <a href="http://ical4j.sourceforge.net/introduction.html" rel="nofollow noreferrer">iCal4J</a> therefore is syntactically correct) and choose the right application to deal with this file. This desire comes from my understanding of the <code>Content-Disposition</code> header (<a href="https://www.rfc-editor.org/rfc/rfc2183" rel="nofollow noreferrer">https://www.rfc-editor.org/rfc/rfc2183</a>). This works finely with Firefox (at least, with Firefox 22). However, this does not work with Chrome, in which the file is simply shown as content inside the calling tab. Moreover, I am not able to find any proof about the <code>automatically create a file</code> which makes me think that is a feature of Firefox and that problems may arise with IE or other browsers as well.<br />
  So, to conclude, my questions are:</p>
  <ol>
  <li>did I understand correctly the <code>Content-Disposition</code> header? Should it serve the purpose to tell the browser to create a file based on the incoming response body content or was this a Firefox-specific feature?</li>
  <li>should it be better if I create a file on the server and then transfer that file?</li>
  </ol>