Use encodeURI in r2.js and implement http upload support