Since in our system we use plupload to handle uploads and access the files through an ID that the server creates in our database we needed the server callback functionality.
Error messages can be returned from the server even if the HTTP request was successful.
It allows for return values from the server when the upload was successful.
It creates a new event called ServerFileIdReport. (Change to a more generic name if you wish, it can be used for any JSON serializable return value.)
Tested and implemented in the HTML5, Flash and HTML4 runtimes. Others can be implemented with ease about 4-5 lines of code. Only reason I didn't implement them is because I had no environment to test it and our system does not require other runtimes in the first place.
Added server callback functionality for HTML5 and Flash.
Added server callback support for HTML4.
Is there a serious reason for this to be in the core? After all you could always get a response from server in FileUploaded handler and process it in a way you require. No?
This solution offers a consistent way to support server side error handling and response sending without requiring that to be implemented in the FileUploaded event. This is a significant feature because it does not require the implementer of this event listener to have knowledge of server side scripts.
We do not bind to any specific response format, JSON-RPC is only an example. Although great suggestion for people looking for how to handle errors passed back in JSON-RPC response. That could be a nice example page in our wiki, here on github. But obviously not merging this one into the core.