Fixed the upload file issue
RE factoring the code
Merge pull request #8 from aptara/Sushil

Sushil