Adding condition to upload files