xforms:upload only worked when using
replace="all". This meant that you could not upload files in the background.
So we have extended support to
replace="none" and you can now simply bind an upload control to an instance, submit that instance as usual, and automatically see the files selected by the user in the upload control sent to the server in the background if necessary. It's as simple as it gets:
<xforms:instance id="file-instance"> <file name="" mediatype="" size=""/> </xforms> <xforms:submit ref="instance('file-instance')" replace="none" method="post" action="/send/my/file"/> ... <xforms:upload ref="instance('file-instance')"> <xforms:label>File to upload</xforms:label> <xforms:filename ref="@name"/> <xforms:mediatype ref="@mediatype"/> <xxforms:size ref="@size"/> </xforms>
In the future we would like to support the
incremental flag on
xforms:upload. This will trigger file upload to the server as soon as a file is selected by the user.
Thanks to Teleflex for supporting this feature!