Fixed a couple of bugs related to calculating the size of the file data and properly generating progress events during the upload.