This is a question for the user list, not the dev list. But since you
asked, you have a few options:
1. Use a dummy request param like "[url....]&.pdf". This will trick the
browser into opening the program. However, you will still have a pretty
funny file name.
2. An approach I have used for byte-streaming files is to create a
servlet mapping that looks like a file name: /file.pdf, but actually
maps to a servlet that handles the request. You may find that posting
to a servlet rather than a struts action will make this easier, though
you could probably make /file.pdf post to a struts action (haven't
tried).
Ben
On Sat, 2003-06-14 at 16:28, RODRIGO CARVALHO DOS SANTOS wrote:
> Hi All,
>
> I�m trying to download a pdf file using a Struts action. I don't
> have the file in my file system, an EJB is returning the file image as a
> ByteArray.
>
> I�m already sending a mime type that�s unknown by the browser
> forcing a download reaction and sending the file name as header property
> like in the following lines:
>
> response.setContentType("application/x-download");
> response.setHeader("Content-disposition", "attachment; filename=" +
> resultVo.getFileName());
>
> The problem is that when the broser receives the response it�s
> prompting the action name not the file name. What are the alternatives to
> this solution?
>
> Thanks in advance,
> Rodrigo.
>
>
> ***** Internet E-mail Confidentiality Footer *****
> "Esta mensagem pode conter informa��es privilegiadas e/ou confidenciais de
> propriedades da BCP Telecomunica��es. Caso voce n�o seja o destinat�rio ou
> pessoa autorizada a recebe-la n�o poder� utiliza-la de forma alguma. C�pia,
> revela��o ou quaisquer outras a��es baseadas nestas informa��es n�o s�o
> autorizadas. Se voce recebeu esta mensagem de forma equivocada, por favor
> informe o emissor imediatamente respondendo a este email e em seguida
> eliminando-o. Agradecemos sua coopera��o."
>
> "This message may contain confidential and/or privileged information belong
> to BCP Telecomunications. If you are not the addressee or authorized to
> receive this for the addressee, you must not use, copy, disclose or take any
> action based on this message or any information herein. If you have received
> this message in error, please advise the sender immediately by reply e-mail
> and delete this message. Thank you for your cooperation."
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
Benjamin Tomasini <[EMAIL PROTECTED]>
NetEverything, LLC
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]