You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Daniele Development-ML <da...@googlemail.com> on 2008/11/05 11:55:24 UTC

Struts Download Action - renaming download file

Hello everybody,
I have implemented a DownloadAction to control the access and to download
some files in my web application. The problem I am having is that when I try
to download any of those file, operation which is done through the above
action, I get as download file name the name of the action (e.g.
downloadJar.do) instead of the file name.

I have searched for documentation / examples on how to overcome this but I
couldn't find anything. Perhaps it is not strictly related to Struts (I
sometimes come across PHP websites with the same problem), however I thought
it was worth asking the mailing list - even for other future references.

Any help / suggestion is highly appreciated.

Thanks!

Dan

Re: Struts Download Action - renaming download file

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
I'm not sure if this is the same "DownloadAction" as you are thinking
of, but I found this resource about setting the Content Disposition:

http://wiki.apache.org/struts/StrutsFileDownload#head-54368bb2778429bd6d32b4ea42b2a15ca111f19a

Nils-H

On Wed, Nov 5, 2008 at 12:13 PM, Antonio <an...@gmail.com> wrote:
> 2008/11/5 Nils-Helge Garli Hegvik <ni...@gmail.com>:
>> Make sure you set the correct Content Disposition.
>
> That's the problem: it seems that there is no way to set the content
> disposition in the StreamInfo, or maybe I cannot see where it can be
> done.
> The StreamInfo interface provides only info about the content type and
> the input stream.
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts Download Action - renaming download file

Posted by Antonio <an...@gmail.com>.
2008/11/5 Nils-Helge Garli Hegvik <ni...@gmail.com>:
> Make sure you set the correct Content Disposition.

That's the problem: it seems that there is no way to set the content
disposition in the StreamInfo, or maybe I cannot see where it can be
done.
The StreamInfo interface provides only info about the content type and
the input stream.

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts Download Action - renaming download file

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
Make sure you set the correct Content Disposition.

Nils-H

On Wed, Nov 5, 2008 at 11:55 AM, Daniele Development-ML
<da...@googlemail.com> wrote:
> Hello everybody,
> I have implemented a DownloadAction to control the access and to download
> some files in my web application. The problem I am having is that when I try
> to download any of those file, operation which is done through the above
> action, I get as download file name the name of the action (e.g.
> downloadJar.do) instead of the file name.
>
> I have searched for documentation / examples on how to overcome this but I
> couldn't find anything. Perhaps it is not strictly related to Struts (I
> sometimes come across PHP websites with the same problem), however I thought
> it was worth asking the mailing list - even for other future references.
>
> Any help / suggestion is highly appreciated.
>
> Thanks!
>
> Dan
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org