I have used the following code to trigger downloads. It used to work in
both FF and IE..
let $filename := ...
let $mimetype := ...
let $content-disposition :=
fn:concat("attachment; filename=",
fn:encode-for-uri($filename))
return (
xdmp:add-response-header("Content-Disposition",$content-disposition),
xdmp:add-response-header("ETag",fn:string(xdmp:random())),
xdmp:set-response-content-type($mimetype),
... (: code to generate or insert the output :) ...
)
Kind regards,
Geert
-----Oorspronkelijk bericht-----
Van: [email protected]
[mailto:[email protected]] Namens Brent Hartwig
Verzonden: woensdag 7 december 2011 14:50
Aan: Betty Harvey
CC: General MarkLogic Developer Discussion
Onderwerp: Re: [MarkLogic Dev General] <xsl:result-document> equivalent
Good deal. I'm guessing it will involve xdmp:add-response-header() for
content-disposition and attachment
(http://support.microsoft.com/kb/260519), but will defer to another who
has already done this, and may also be able to speak to cross-browser
support.
-Brent
-----Original Message-----
From: Betty Harvey [mailto:[email protected]]
Sent: Wednesday, December 07, 2011 8:56 AM
To: Brent Hartwig
Cc: General MarkLogic Developer Discussion
Subject: RE: [MarkLogic Dev General] <xsl:result-document> equivalent
That would work. I am not sure how to do that since I haven't found a way
to put information, i.e., processing instructions, before the root
element.
Betty
> Gotcha. I was thinking dev. So is this a matter of manipulating the
HTTP
> headers, instructing the browser to display the file download dialog?
>
> -Brent
>
> -----Original Message-----
> From: Betty Harvey [mailto:[email protected]]
> Sent: Wednesday, December 07, 2011 8:41 AM
> To: Brent Hartwig
> Cc: General MarkLogic Developer Discussion; [email protected]
> Subject: RE: [MarkLogic Dev General] <xsl:result-document> equivalent
>
> Thanks Brent - I prefer not to store it in MarkLogic but in a pinch it
> will work|-)!
>
> Betty
>
>> Hi, Betty,
>>
>> Would xdmp:save() work? It writes a node to a specified path on the ML
>> server.
>>
>> -Brent
>>
>> -----Original Message-----
>> From: [email protected]
>> [mailto:[email protected]] On Behalf Of Betty
>> Harvey
>> Sent: Wednesday, December 07, 2011 8:32 AM
>> To: General MarkLogic Developer Discussion
>> Subject: [MarkLogic Dev General] <xsl:result-document> equivalent
>>
>> I am creating a very large file. The result file crashes the browser
>> when
>> running it directly using http or using CQ because of its size.
>>
>> Is there an equivalent function in MarkLogic of <xsl:result-document>
so
>> the file can be saved directly on the file system.
>>
>> TIA!
>>
>> Betty
>>
>> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
>> Betty Harvey | Phone: 410-787-9200 FAX: 9830
>> Electronic Commerce Connection, Inc. |
>> [email protected] | Washington,DC XML Users Grp
>> URL: http://www.eccnet.com | http://www.eccnet.com/xmlug
>> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
>> Member of XML Guild (www.xmlguild.org)
>> _______________________________________________
>> General mailing list
>> [email protected]
>> http://developer.marklogic.com/mailman/listinfo/general
>>
>
>
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
> Betty Harvey | Phone: 410-787-9200 FAX: 9830
> Electronic Commerce Connection, Inc. |
> [email protected] | Washington,DC XML Users Grp
> URL: http://www.eccnet.com | http://www.eccnet.com/xmlug
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
> Member of XML Guild (www.xmlguild.org)
>
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Betty Harvey | Phone: 410-787-9200 FAX: 9830
Electronic Commerce Connection, Inc. |
[email protected] | Washington,DC XML Users Grp
URL: http://www.eccnet.com | http://www.eccnet.com/xmlug
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
Member of XML Guild (www.xmlguild.org)
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general