Hi,

I have a portlet which brings a blob object from the database and I am able
to read that and show that in the same portlet view.
But I want to be able to allow the user to download the content as a doc.
So I have put in the code as below:
::Converting to char because I can not write the bytes using Portlet
response writer::
:: it is not allowing to use outputstream and then writer to write bytes::

::: The bigest problem is according to the below code it is suppose to ask
me for downloading the content of the blob as world doc with name test.doc::
:: AND IT IS NOT DOING THAT IT IS JUST WRITING THAT Content IN THE PORTLET
AREA::

        byte[] pBuf=fileBlob.getBytes(1, (int)fileBlob.length());
        String str=new String(pBuf,0,pBuf.length);
        response.setContentType("application/doc");
        response.setHeader("Content-Disposition", "attachment;
filename=test.doc");
        response.getWriter().write(str);

Any one has any idea to fix this please respond soon...it is so annoying
that this small this is not working... For so many hours....

Regards,
Santosh

Reply via email to