diff --git a/src/app/components/ImgInputForm.client.tsx b/src/app/components/ImgInputForm.client.tsx index 96f27ce..7917fb5 100644 --- a/src/app/components/ImgInputForm.client.tsx +++ b/src/app/components/ImgInputForm.client.tsx @@ -29,15 +29,26 @@ const ImgInputForm_client = () => { if (file) file.click() } - const confirm = () => { - + const confirm = async () => { + const files = fileRef.current?.files + if (files) { + const file = files[0] + const fomrData = new FormData() + fomrData.append("image", file) + console.log("here") + console.log(file.size) + await fetch("http://localhost:9001/img/get-img", { + method: "POST", + body: fomrData + }) + } } return ( <> -
+
{ preview && - + }