cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <va...@reverycodes.com>
Subject Re: set another filename\extension
Date Fri, 21 Mar 2008 16:10:14 GMT
On Mar 21, 2008, at 5:29 AM, Rainer Pruy wrote:

> The filename used for "saving a file to disk" is at the discretion  
> of the browser.
> HTTP provides "suggesting" a name, but not all  browsers follow such  
> suggestion.

IIRC all decent and all recent browsers support this. At least I've  
not heard of any of my users complaining :) You can either use  
HttpHeaderAction action

   <map:act type="header">
     <map:parameter name="Content-Disposition" value="attachment;  
filename=somefilename.xls"/>
   </map:act>

or you can do the same from flowscript.


> The most reliable way on getting a suitable filename is thus,  
> generating a URL that "ends" in
> the target filename (e.g. via means of redirect from cocoon or at  
> time of generating the Link in the first place).
> (in your example:  foo/getfile?filename=somename.html)

I remember that was a hack required for the IE 5 or so with Acrobat  
Reader. It might still be needed...

Vadim


> Any approaches to set HTTP headers would be available using some  
> actions and passing parameters to the serializers
> might not convince the bowser to use the expected filename in the end.
>
> Rainer
>
> nanomonk schrieb:
>> for example I have:
>> _____
>>
>> <map:match pattern="foo/getfile">
>>    <map:generate src="foo/getfile.xsp" type="serverpages"/>
>>    <map:serialize type="file-serializator"/>
>> </map:match>
>> _____
>> it works fine, file is generating and response. But this file have  
>> filename
>> == "getfile" and without extension. Can I set another filename(or  
>> just set
>> extension) without changing "foo/getfile"?
>> Reason - file is generating according different parameters of  
>> request.

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


Mime
View raw message