You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Pi Trash <pt...@web.de> on 2009/05/25 14:10:12 UTC

File names of dynamic web resources

I am using DynamicWebResource to provide links to download files stored in a database. The only thing I do is to override the getData() and getContentType() method of a ResourceState I return in the getResourceState() method of the Dynamic WebResource.

How can I configure the name of the file which is displayed in the 'save as' dialog of the browser?

tia
__________________________________________________________________________
Verschicken Sie SMS direkt vom Postfach aus - in alle deutschen und viele 
ausländische Netze zum gleichen Preis! 
https://produkte.web.de/webde_sms/sms




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: File names of dynamic web resources

Posted by Günther Enthaler <ge...@mac.com>.
If you just click the link, both IE & Firefox use the file name configured in
response.setAttachmentHeader().

However, if you right-click the link & Save Link As..., I found IE uses the
file name configured in response.setAttachmentHeader(), but Firefox uses the
file name part of the href. So you'll probably want to make sure they're the
same.

Cheers,
Günther


Clint Popetz-2 wrote:
> 
>     protected void setHeaders(WebResponse response)
>     {
>         super.setHeaders(response);
>         response.setAttachmentHeader('your_name_here.txt");
>     }
> 

-- 
View this message in context: http://www.nabble.com/File-names-of-dynamic-web-resources-tp23706024p23706850.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: File names of dynamic web resources

Posted by Clint Popetz <cl...@42lines.net>.
    protected void setHeaders(WebResponse response)
    {
        super.setHeaders(response);
        response.setAttachmentHeader('your_name_here.txt");
    }



On Mon, May 25, 2009 at 7:10 AM, Pi Trash <pt...@web.de> wrote:

> I am using DynamicWebResource to provide links to download files stored in
> a database. The only thing I do is to override the getData() and
> getContentType() method of a ResourceState I return in the
> getResourceState() method of the Dynamic WebResource.
>
> How can I configure the name of the file which is displayed in the 'save
> as' dialog of the browser?
>
>



-- 
Clint Popetz
http://42lines.net
Scalable Web Application Development

Re: File names of dynamic web resources

Posted by James Carman <jc...@carmanconsulting.com>.
Two of the constructors for DynamicWebResource take "filename"
parameters.  Have you tried using them?

On Mon, May 25, 2009 at 8:10 AM, Pi Trash <pt...@web.de> wrote:
> I am using DynamicWebResource to provide links to download files stored in a database. The only thing I do is to override the getData() and getContentType() method of a ResourceState I return in the getResourceState() method of the Dynamic WebResource.
>
> How can I configure the name of the file which is displayed in the 'save as' dialog of the browser?
>
> tia
> __________________________________________________________________________
> Verschicken Sie SMS direkt vom Postfach aus - in alle deutschen und viele
> ausländische Netze zum gleichen Preis!
> https://produkte.web.de/webde_sms/sms
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org