title: How to create a file in memory then send the file to the user through asp.net mvc + jquery?
body: <p>I am using Dday calendar library and I want to export the users calendars. So I use the Dday to take all the users records and make it into ical format(.ics). </p>
  
  <p>Now I want to take this and send it back to the user. However I really don't want to first generate a file on the server then send it to them. If I can I rather do it in in memory and send it to them.</p>
  
  <p>If it is however alot of work I will settle for a way that saves it on the server allows the user to download it and then deletes it after they finished downloading it(I don't want the file to be on my server for more then a few mins).</p>
  
  <p>I also am not sure how to send it back the users. I always prefer to do an ajax post to the server with jquery then somehow have the file come back and popup for the user.</p>
  
  <p>Again if this is alot of work I will settle for something server side way that asp.net mvc handles it all.</p>
  
  <p>But I don't know how to do either way.</p>
  
  <p>So how can I do this?</p>