file upload function working for single files