Uploading logic.