added XHR for uploading a file via JSON-RPC