when you upload the first time. it's good but the second time it's showing an error add this file.target.files.length === 1 && reader.readAsDataURL(file.target.files[0]) after