views:

41

answers:

1

Hi all, I'm familiar with generating office documents server-side by including the following at the top of the response:

<%
Response.Buffer = True
Response.ContentType = "application/msword"
Response.AddHeader "content-disposition", "inline; filename = ASP_Word_Doc.doc"
%>

I'm currently facing the challenge of doing this purely client-side. I've got an XSL transform that successfully generates valid Word XML. Can anybody give me a pointer to how to reproduce this behaviour using purely client-side javascript?

I've found the document.open method, but that only supports text/html.

Ideally I'd like a cross-browser solution - but IE only would be a satisfactory fall-back

cheers, Ian

A: 

To answer one part of your question, Downloadify is a Flash-based JS helper library that lets you generate any kind of file for download locally.

Unicron
thanks, but I'm afraid it doesn't meet the "using purely client-side javascript?" constraint
ianmayo
@ian to the best of my knowledge, it's not possible at all in pure client-side Javascript - that's the reason why that helper library exists. If that doesn't do for you, I think you will have to do an Ajax request to a server, send it the file data and request a file download back.
Unicron