refactored upload to save binary string directly into mongo database