[MarkLogic Dev General] learn to download ingested file

Asit Nautiyal asitnautiyal at outlook.com
Sat Jul 18 01:59:23 PDT 2015


Hi,
 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";
xdmp:set-response-content-type("application/pdf"),xdmp:add-response-header("Content-Disposition",fn:concat("attachment; filename=mypdf.pdf")),fn:doc("/mypdf.pdf")


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




Hi ,
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>>")

Regards,Asit Nautiyal
> 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
> 
> ./attachments:
> fresh~1.pdf
> 
> 
>    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: 
> http://developer.marklogic.com/mailman/listinfo/general
 		 	   		  

_______________________________________________
General mailing list
General at developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20150718/2704196a/attachment.html 


More information about the General mailing list