> I have also tried changing the getDoc to return an array of bytes and
> trying to morph that back into a valid file but I failed.
You should do that. A .doc file cannot be represented by arrays of
characters
since they are binary data.

> Here's the code.  I've tried multiple permutations of commenting out
> and/or changing the first two lines.
>
> <%
>     response.setHeader("Content-Disposition", "inline;
> filename=word.doc");
>     response.setHeader( "Content-type", "binary/octect-stream");
>     String myWordDoc = junk.getDoc();
>     out.print ( myWordDoc );
> %>
You are using the binary/octet-stream MIME type because you want the browser
to download the file, I hope so. I dont know your implementation of this
getDoc method
but I am sure using a String-typed reference to store its return value is
not appropriate.

Try working with simple byte arrays and then optimize your implementation to
take
advantage of the java.io package.

Hope it helps.

Fernando Ribeiro
Project Engineer
Organic, Inc

> Eric Butler
> (VP Product Development & Founder)
> MDinTouch, Inc.
> 786.268.1161
> http://www.mdintouch.com
> [EMAIL PROTECTED]
> ------------------------------------------------------

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to