update file upload method to avoid duplicate file records