Add size checking before uploading

Change-Id: I8e105fb83007223cdcb91c8414b76946e038b827
Merge "Add size checking before uploading"