Fix upload progress bars.

Was never actually calculating the percent properly.
Also add a sample.