File uploading and progress bar done the right way