Loading TOC...

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"

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