MarkLogic Server 11.0 Product Documentation
xdmp.getRequestFieldContentType

xdmp.getRequestFieldContentType(
   field-name as String
) as Sequence

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.getRequestFieldFilename.

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.getRequestField documentation.

Example

//   Returns the content type of the files loaded in the
//   "upload" input form element.

xdmp.getRequestFieldContentType("upload");
=> "application/msword"
Powered by MarkLogic Server | Terms of Use | Privacy Policy