<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.getRequestFieldContentType.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.getRequestFieldContentType</api:function-name><api:suggest>xdmp.getrequestfieldcontenttype</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>getrequestfieldcontenttype</api:suggest><api:function-link mode="xquery" fullname="xdmp:get-request-field-content-type">/apidoc/8.0/xdmp:get-request-field-content-type.xml</api:function-link><api:function mode="javascript" name="getRequestFieldContentType" type="builtin" lib="xdmp" category="AppServerBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.getRequestFieldContentType"><api: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
  <code xmlns="http://www.w3.org/1999/xhtml">xdmp:get-request-field-filename</code>.
</api:summary><api:params><api:param name="field-name" type="xs:string"><api:param-description>
    The name of the request field with the multipart request.
  </api:param-description><api:param-name>field-name</api:param-name><api:param-type>String</api:param-type></api:param></api:params><api:return>ValueIterator</api:return><api:usage>
  This function is useful for file upload applications.  For an example, see
  the  
  <a href="./xdmp.getRequestField#grf2js" class="javascript" xmlns="http://www.w3.org/1999/xhtml">second 
  example in the
  <code>xdmp.getRequestField</code></a> documentation.
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
//   Returns the content type of the files loaded in the
//   "upload" input form element.

xdmp.getRequestFieldContentType("upload");
=&gt; "application/msword"
</pre></api:example></api:function></api:function-page>