Loading TOC...

MarkLogic 12 EA 1 Product Documentation
xdmp:get-request-field-content-type

xdmp:get-request-field-content-type(
   $field-name as xs:string
) as xs:string*

Summary

This function is used to extract the content type from the request field. It returns a sequence of content types, one for each filename, in the same order as the filenames returned from xdmp:get-request-field-filename .

Parameters
field-name The name of the request field with the multipart request.

Usage Notes

This function is useful for file upload applications. For an example, see the second example in the xdmp:get-request-field documentation.

Example

(:
   Returns the content type of the files loaded in the
   "upload" input form element.
:)
xdmp:get-request-field-content-type("upload")
=> "application/msword"

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