Use promise for upload
Merge pull request #2 from xtang/get-token-before-upload

Use promise for upload