<pre class="brush:xml">
<form name="myForm" action="/upload" method="POST" enctype="multipart/form-data">
Your Name: <input type="hiddentext" name="testuser-key" value="test-valuename" /><br/> <input type="file" name="files[]" multiple="multiple" />
</form>
</pre>
In XQuery, the names and values of the {{Code|input}} elements will be represented as a [[Map module|map]]. Uploaded files (i. e., inputs of type {{Code|file}}) result in a filename and the file content, which is why the value of file inputs will thus be represented in an additional map. The following example stores all uploaded files in a temporary directory and reports size and name of the filesreturns XML elements for all inputs:
<pre class="brush:xquery">
)
) else (
(: handles remaining other inputs :)
<input name="{ $key }" value="{ $value }"/>
)
};
</pre>
The value of the hidden form element {{Code|example1}} is stored into {{Code|$example1}}. Additionally, you can calculate the size of the uploaded file using {{Code|count(convert:binary-to-bytes($content))}}.
=References=