You need to read the file as binary not text.  The link is correct.
Use xdmp:external-binary to read binary files

https://docs.marklogic.com/xdmp:external-binary





-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
[email protected]
Phone: +1 812-482-5224
Cell:  +1 812-630-7622
www.marklogic.com<http://www.marklogic.com/>


From: [email protected] 
[mailto:[email protected]] On Behalf Of Jakob Fix
Sent: Wednesday, June 12, 2013 12:17 PM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] problem with xdmp:filesystem-file on Windows

Hi,

we're encountering a problem reading a PDF file via xdmp:filesystem-file on a 
Windows 2008 server (EA2).

The problem also exists for ML 6 and is explained here:

http://learnxquery.blogspot.fr/2012/08/not-possible-to-read-pdf-from-file.html

We can read other files, like HTML or Excel, but not PDFs (we tried several 
sizes and PDF versions). The file seems to be truncated (we receive only about 
2kb, or even nothing.).

Stacktrace in qconsole:

[1.0-ml] XDMP-READFILE: for $r in $results -- ReadFile File is not in UTF-8: 
C:/Applications/kappav3/backend/kv3-jfix-contents-library/f-78/51758045038371473.pdf
Stack Trace
In /qconsole/endpoints/evaler.xqy on line 276
In 
local:format-eval-result(xdmp:filesystem-file("C:/Applications/kappav3/backend/kv3-jfix-contents-library/f-78/51758045038371473.pdf"))
$results := 
xdmp:filesystem-file("C:/Applications/kappav3/backend/kv3-jfix-contents-library/f-78/51758045038371473.pdf")

Thanks,
Jakob.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to