reimplemented logic for single file upload