Working upload progress bar

I previously listened for the "progress" event, but it was the download
progress event instead of the upload one. Thus, if we're sending data
with the http() function in Javascript it'll listen to the upload
progress event and otherwise the download one.