I want to upload 4 images one by one to server, in response i will get 4 urls and save all urls in a state in react
const multiStatement= async(e) => {
const files = e.target.files;
const fd = new FormData()
files.map(img=>{
fd.append(`file`, img)
const res = axios.post(url,fd)
console.log( res.data.url)//save this url
})
}
<input type="file" id="file" multiple name="file" onChange={multiStatement} />