Loading TOC...


   $path as xs:string,
   [$starting-location as xs:double],
   [$length as xs:double]
) as binary()


Returns an external binary node.

$path Filesystem path to the external binary file.
$starting-location The new binary node starts at the byte position indicated by starting-location. The first byte is at location 1. The default value is 1.
$length The length in bytes of the content in the new binary node. Omitting the length has performance implications; see usage notes.

Required Privileges


Usage Notes

If no length is provided, the length is calculated from the starting position and the filesystem length of the external file. If the file does not exist when the length is calculated, XDMP-MISSINGFILE is thrown.

If a length is provided, the length is trusted. That is, no attempt is made to confirm the existence or read the length of the external file. Therefore, including the length in the call (if known) results in the best performance during document creation.


  xdmp:external-binary("/testdata1/logo.gif", 1, 2456)

  => A binary node representing the external file at
     /testdata1/logo.gif, beginning at offset 1, with
     a length of 2456 bytes.

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.


The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.
  • CLASSIC NOTCH Have you ever wondered why people get so easily scammed by imposters all over the Web? It's no other reason than their vulnerability caused by desperation to get a problem fixed, which has led to Millions being ripped off their hard earned wealth and that's why Classic Cyber Notch has come to bring an end to this wicked act and help already scammed victims get their hard earned wealth back. Classic Notch is a body of well Seasoned professional Hackers whom are well equipped with what it takes to getting your lost wealth either probably through Binary options recovery scam back or lost via other means. We do jobs ranging from Securing Cyber Security stance, to Cyber Hijacking of diverse types. Such as: Private investigating Phone hack Recovery of passwords/documents Clearing of Criminal records Binary options Recovery Issuing of Blank ATM Bit coin mining And many more.. Etc. Reach us via E-mail : Classic cyber notch at gmail dot com Classic cyber hacks at gmail dot com to put a smile back on your face. Signed, Collins .A.
  • this function does not really place the binary data into memory, but rather a pointer to the file system. Thus, if the file is deleted or renamed in the file system, the database object pretending to contain the data would throw an error in the first instance when the actual data is attempted to be loaded.
    • That is correct. External binaries are designed for binary data that should not be managed by MarkLogic. You can learn more about them here: http://docs.marklogic.com/guide/ingestion/formats#id_24381 and http://docs.marklogic.com/guide/app-dev/binaries. If you want MarkLogic to manage your binary content (which is the more common case), use the usual document insertion methods, such as xdmp:document-load and xdmp:document-insert.