DSpace/DSpace — pull request #292 by abollini (2013-08-30 10:33:21+00:00)
Title: DS-1639 AJAX progress bar for file upload in JSPUI

This PR add a progress bar indicator to the upload step for JSPUI.
Unfortunately, it DOESN'T implement yet chunked/large file upload or any other HTML5 features.

It makes use of the well known iframe technique supported by old browsers (tested with IE, FF and chrome) to allow the upload to process in background, the progress bar is implemented with jquery ui and the progress status is retrieved from the server using apache file upload listener and gson serialization. When the upload complete an hidden form is submitted (without file) to the SubmissionController so that the process can proceed usually. If an error is thrown (file size, network error, virus check) a jquery dialog is shown.

The feauture is enabled by default but can be completly disabled setting
webui.submit.upload.ajax = false

Finally, I have tried for several days to integrate the jquery-file-upload plugin without success.
https://github.com/abollini/DSpace/tree/DS-1639-jquery

The format of the JSON response is ready to use with the plugin and I have also used their css for improve our UI with open/cancel buttons but I have found the following issues that I was not able to solve:
- progress bar don't work in < IE 10 to work It needs the server side processing
- XHR request management look bugly (maybe caused by my integration code): user aborted request will be resumed when a new file is selected, failure on the server side (code 413) are ignored by the plugin that still load the full file before fire the fail event, other XHR request are confused by the plugin with the upload request showing progress data of such requests.

We can rework on the plugin integration for a future version hope revising the entire upload process and take advantage of HTML5 large file support, multiple upload, etc.