A small wrapper around XHR to ease file uploading