You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lionel Crine <cr...@4dconcept.fr> on 2003/09/12 13:50:20 UTC

[SOLUTION] Downloading file into local Disk

I found a solution wich work perfectly with IE and mozilla and firebird.

Here is the pipeline :

       <map:match pattern="save/*">
         <map:act type="header">
           <map:parameter name="Pragma" value="no-cache" />
           <map:parameter name="Content-Disposition"
           value="attachment ; filename=test.xml" />
           <map:parameter name="Content-Type"
           value="binary/octet-stream" /> --> this parameter is not understood
         </map:act>
         <map:read type="resource" src="D://{1}" 
mime-type="binary/octet-stream"/>
       </map:match>

OR :

       <map:match pattern="save/*">
         <map:act type="header">
           <map:parameter name="Pragma" value="no-cache" />
           <map:parameter name="Content-Disposition"
           value="attachment ; filename=test.xml" />
           <map:parameter name="mime-type"
           value="binary/octet-stream" />
         </map:act>
         <map:read type="resource" src="D://{1}"/>
       </map:match>


I don't know which is the cleanest. I'll keep the first one.

Lionel




At 18:05 11/09/2003 +0200, you wrote:
>Hi,
>
>I'd like my browser web not to display the xml document but to open a 
>download popup.
>
>I hae created a serializer with a mime-type set to binary/octet-stream, 
>but when I try :
><map:match pattern="save.xml">
>   <map:generate type="file" src="toto.xml"/>
>   <map:serializer type="save"/>
></map:match>
>
>
>the browser display the document.
>
>Else if I try to write <map:match pattern="save.t"> instead, the download 
>popup comes up!!!
>
>Any idea ?
>
>Thanks
>Lionel
>
>
>
>Lionel CRINE
>Société : 4DConcept
>22 rue Etienne de Jouy 78353 JOUY EN JOSAS
>Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org


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


Re: [SOLUTION] Downloading file into local Disk

Posted by Lionel Crine <cr...@4dconcept.fr>.
Yes.
Is there a place where to put it ?

At 07:57 12/09/2003 -0400, you wrote:
>Can you wiki this?
>
>Lionel Crine wrote:
>>I found a solution wich work perfectly with IE and mozilla and firebird.
>>Here is the pipeline :
>>       <map:match pattern="save/*">
>>         <map:act type="header">
>>           <map:parameter name="Pragma" value="no-cache" />
>>           <map:parameter name="Content-Disposition"
>>           value="attachment ; filename=test.xml" />
>>           <map:parameter name="Content-Type"
>>           value="binary/octet-stream" /> --> this parameter is not 
>> understood
>>         </map:act>
>>         <map:read type="resource" src="D://{1}" 
>> mime-type="binary/octet-stream"/>
>>       </map:match>
>>OR :
>>       <map:match pattern="save/*">
>>         <map:act type="header">
>>           <map:parameter name="Pragma" value="no-cache" />
>>           <map:parameter name="Content-Disposition"
>>           value="attachment ; filename=test.xml" />
>>           <map:parameter name="mime-type"
>>           value="binary/octet-stream" />
>>         </map:act>
>>         <map:read type="resource" src="D://{1}"/>
>>       </map:match>
>>
>>I don't know which is the cleanest. I'll keep the first one.
>>Lionel
>>
>>
>>At 18:05 11/09/2003 +0200, you wrote:
>>
>>>Hi,
>>>
>>>I'd like my browser web not to display the xml document but to open a 
>>>download popup.
>>>
>>>I hae created a serializer with a mime-type set to binary/octet-stream, 
>>>but when I try :
>>><map:match pattern="save.xml">
>>>   <map:generate type="file" src="toto.xml"/>
>>>   <map:serializer type="save"/>
>>></map:match>
>>>
>>>
>>>the browser display the document.
>>>
>>>Else if I try to write <map:match pattern="save.t"> instead, the 
>>>download popup comes up!!!
>>>
>>>Any idea ?
>>>
>>>Thanks
>>>Lionel
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org


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


Re: [SOLUTION] Downloading file into local Disk

Posted by Geoff Howard <co...@leverageweb.com>.
Can you wiki this?

Lionel Crine wrote:
> I found a solution wich work perfectly with IE and mozilla and firebird.
> 
> Here is the pipeline :
> 
>       <map:match pattern="save/*">
>         <map:act type="header">
>           <map:parameter name="Pragma" value="no-cache" />
>           <map:parameter name="Content-Disposition"
>           value="attachment ; filename=test.xml" />
>           <map:parameter name="Content-Type"
>           value="binary/octet-stream" /> --> this parameter is not 
> understood
>         </map:act>
>         <map:read type="resource" src="D://{1}" 
> mime-type="binary/octet-stream"/>
>       </map:match>
> 
> OR :
> 
>       <map:match pattern="save/*">
>         <map:act type="header">
>           <map:parameter name="Pragma" value="no-cache" />
>           <map:parameter name="Content-Disposition"
>           value="attachment ; filename=test.xml" />
>           <map:parameter name="mime-type"
>           value="binary/octet-stream" />
>         </map:act>
>         <map:read type="resource" src="D://{1}"/>
>       </map:match>
> 
> 
> I don't know which is the cleanest. I'll keep the first one.
> 
> Lionel
> 
> 
> 
> 
> At 18:05 11/09/2003 +0200, you wrote:
> 
>> Hi,
>>
>> I'd like my browser web not to display the xml document but to open a 
>> download popup.
>>
>> I hae created a serializer with a mime-type set to 
>> binary/octet-stream, but when I try :
>> <map:match pattern="save.xml">
>>   <map:generate type="file" src="toto.xml"/>
>>   <map:serializer type="save"/>
>> </map:match>
>>
>>
>> the browser display the document.
>>
>> Else if I try to write <map:match pattern="save.t"> instead, the 
>> download popup comes up!!!
>>
>> Any idea ?
>>
>> Thanks
>> Lionel



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