I'm trying to upload images using react js but I'm not able to upload multiple images at the same time even though I gave input as multiple.
<input type="file" title="" className={styles.inputFile} multiple={true} onChange={handleChange} />
const [formData, setFormData] = useState({
orgId: "6114285831310bfd5b09c28178e",
orgWallpaper: [],
});
const handleChange = (e) => {
if (e.target.files && e.target.files[0]) {
setFormData((form) => ({
...form,
orgWallpaper: [...form.orgWallpaper, URL.createObjectURL(e.target.files[0])],
}));
}
};
{formData?.orgWallpaper?.map((item, key) => (
{console.log(item, "mapitem")}
<img className={styles.wallpapers + " " + styles.active} src={item} alt="" />