const ref = useRef(null); const onSubmitImage = async (ref: any) => { const formData = new FormData() const image = await domtoimage.toBlob(ref.current); const myFile = new File([image], 'image.jpeg', { type: image.type, }); formData.append("fileCategory", "INSIGHT_ATTACHED_FILE") formData.append("targetFile", myFile) return axios .post('image-upload-url', formData, { headers: { 'Content-Type': ..