[MarkLogic Dev General] learn to download ingested file
asitnautiyal at outlook.com
Sat Jul 18 01:59:23 PDT 2015
Place this code into xquery file named "docDownload.xqy". Deploy in desired http server then try like http://<<localhost OR ip-address>>:<<http-server-port-number>>/docDownload.xqy
xquery version "1.0-ml";
Regards,Asit NautiyalFrom: asitnautiyal at outlook.com
To: general at developer.marklogic.com
Date: Sat, 18 Jul 2015 08:37:05 +0000
Subject: Re: [MarkLogic Dev General] learn to download ingested file
You can extends MarkLogic REST APIs by creating your custom xquery code file to download files.
There you have to set xdmp:set-response-content-type("application/pdf") and
xdmp:add-response-header("Content-Disposition",fn:concat("attachment; filename=",<<your pdf file name>>))
and then just return fn:doc("<<URI of you pdf file>>")
> To: general at developer.marklogic.com
> From: info at cyanline.com
> Date: Fri, 17 Jul 2015 14:49:37 -0400
> Subject: [MarkLogic Dev General] learn to download ingested file
> Hi all,
> What resources can I use to learn how to allow the user interface to
> download a file that was ingested into ML?
> I am breaking apart an email archive, storing the metadata in XML
> format, and copying attachments to the email messages into a directory.
> Then, it is all ingested into ML.
> On my rest-app results I set the attachment file name to display, and
> now I am looking to make it a link to serve the user the attachment file.
> Below is an example:
> [message-65] ls -R 18:41:45
> attachments message-65.xml
> I'm using ML7 and I searched markmail developer list for similar
> queries, to no avail.
> Thank you
> General mailing list
> General at developer.marklogic.com
> Manage your subscription at:
General mailing list
General at developer.marklogic.com
Manage your subscription at:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the General