Friday, June 28, 2013

Better uploads in Orbeon Forms 4.2

Browser uploads have gone through a lot since the beginning of the web. It is now possible, with standard APIs, to perform uploads in the background, to obtain file metadata, and even to handle drag and drop of files.
In Orbeon Forms 4.2, we improved file upload in a few respects.

1. Better notification message

Applications need to be informed of the status of file uploads. For example, you usually don't want to allow the user to save or submit form data if there are pending uploads. Orbeon Forms has been checking for this for a long time, but 4.2 makes it more flexible with the new buttons and processes feature (blogdoc).

You also want to be able to notify the user if an upload has completed, whether successfully or because of an error. With Orbeon Form 4.2, we improved notification events at the XForms level, and Form Runner uses them to keep the user informed by displaying success and error messages.


2. Better handling of uploads that are "too large"

Java servlet-based containers do not let the application explicitly close the connection to the client. Say that the server decides to abort an upload because it is beyond the maximum allowed size: the server can reject the upload, but the client will keep uploading the file. This is not good for performance and bandwidth usage.

With Orbeon Forms 4.2, the server tells the client to abort the upload connection in this case, so there is very little waste of bandwidth once the situation is detected.

3. Better "cancel" button

For the same reason, the client now immediately closes the upload connection to the server when the user presses the "cancel" button.

All these changes are documented in the 4.2 release notes. In the future, we hope to improve uploads even more. See in particular these RFEs: #1003,  #996, and #1096.

As usual, feedback is welcome!

1 comment: