Which version of Jetspeed do you use? I wrote a DownloadAction myself only 1 day ago. Even though I experienced the troubles you described some time ago, when I wanted to do the same. After having a look at the code, I realized a comment in RunDataFactory (or RunData class) which indicated, that this problem is fixed.
I used version 1.4b4 and it works. Danny > -----Urspr�ngliche Nachricht----- > Von: Sami Leino [mailto:[EMAIL PROTECTED] > Gesendet: Donnerstag, 1. April 2004 16:09 > An: [EMAIL PROTECTED] > Betreff: J1: serving binary files through a portlet? > > > I am building a small bulletin-board system which should support > attachments as well. For that, I would need to serve binary > content from a > PortletAction or Portlet class. Is this possible with J1? > > The procedure I should do is: > > 1) Set "content-disposition" header to contain the correct filename > 2) Set "content-type" header to "application/octet-stream" or > something > more accurate if the information is present in attachment metadata > 3) Dump the content using a ServletOutputStream > > I tried to do this within a PortletAction class, but Jetspeed > has already > obtained a Writer prior to calling the PortletAction and therefore I > cannot obtain ServletOutputStream from HttpServletResponse. > As you know, > Writer shouldn't be used for binary data because it may perform some > character encoding on the content, and it might break the attachments. > > Do I need to create a separate servlet for serving the attachments? I > wouldn't want to do that, because Jetspeed offers authorization and I > would really like to fully utilize it. > > Regards, > > Sami > > -- > > Sami Leino > Software Developer > Netorek Oy > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
