`\r\n- Add a script tag and create a new method `onInputChange` like this : \r\n````\r\nonInputChange (e) {\r\n const file = e.target.files\r\n await $fetch('/api/uploadFile', {\r\n method: \"POST\",\r\n body: {\r\n files: file\r\n },\r\n headers : {\r\n \"Content-Type\": \"multipart/form-data\"\r\n }\r\n })\r\n}\r\n````\r\n- After that create a new ssr api in the `server/api` directory like this : \r\n\r\n````\r\nimport FormData from \"form-data\";\r\nimport { manageErrorServer } from \"~~/utils/manageErrorServer\";\r\nexport default defineEventHandler(async (event) => {\r\n const config = useRuntimeConfig();\r\n const body = await useBody(event);\r\n try{\r\n const res: Record\u003Cstring, any> = await $fetch(\r\n ${config.API_BASE_URL}+\"smart-product\",{ \r\n method: 'POST',\r\n body: body,\r\n headers: {\r\n \"Content-Type\": \"mutlipart/form-data\"\r\n }\r\n }\r\n )\r\n return res\r\n } catch (e) {\r\n console.log(\"erreur \" + e.response)\r\n manageErrorServer(e);\r\n }\r\n });\r\n````\r\n### Describe the bug\r\n\r\nThe multipart/form-data is not sent by $fetch, either on the first call to the ssr api or on the second call to the backend\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n_No response_",[3088,3091],{"name":3089,"color":3090},"3.x","29bc7f",{"name":3092,"color":3093},"upstream","E8A36D",15003,"cannot send FormData in `$fetch` body","2024-04-15T18:42:31Z","https://github.com/nuxt/nuxt/issues/15003",0.6458201,{"description":3100,"labels":3101,"number":3104,"owner":3027,"repository":3105,"state":3067,"title":3106,"updated_at":3107,"url":3108,"score":3109},"Redirect to: https://v3.nuxtjs.org/community/getting-help/",[3102],{"name":3021,"color":3103},"1ad6ff",542,"nuxt.com","[Community] Guide page integration `/community/guide`","2022-06-07T09:41:37Z","https://github.com/nuxt/nuxt.com/issues/542",0.65028423,{"description":3111,"labels":3112,"number":3104,"owner":3027,"repository":3066,"state":3067,"title":3119,"updated_at":3120,"url":3121,"score":3109},"Same code in source file: `console.log(useRuntimeConfig())`\r\n\r\n```\r\n// dev mode\r\n{\r\n app: { baseURL: '/', buildAssetsDir: '/_nuxt/', cdnURL: '' },\r\n nitro: { routeRules: { '/__nuxt_error': [Object] }, envPrefix: 'NUXT_' },\r\n public: {\r\n enablePreview: true,\r\n baseDomain: 'http://localhost:3000'\r\n },\r\n}\r\n```\r\n\r\n```\r\n// test mode\r\n{ public: {}, app: { baseURL: '/' } }\r\n```",[3113,3116,3118],{"name":3114,"color":3115},"bug","d73a4a",{"name":3037,"color":3117},"7057ff",{"name":3060,"color":3061},"useRuntimeConfig returns not align to dev mode","2023-12-02T00:27:12Z","https://github.com/nuxt/test-utils/issues/542",{"description":3123,"labels":3124,"number":3128,"owner":3027,"repository":3027,"state":3067,"title":3129,"updated_at":3130,"url":3131,"score":3132},"We are stuck on 3.16.2 and cannot upgrade to the latest version because of this issue (and #32006) and we really need to upgrade for there are some other fixes in the latest version that we can benefit from. \n\nThe same as #31962 \n\nReproduction\n\nhttps://github.com/raminjafary/nuxt-upload-formdata-repro\n\nThe error is `Cannot serialize File`\n",[3125],{"name":3126,"color":3127},"🔨 p3-minor","FBCA04",32000,"useFetch FormData handling crashes v3.17.2","2025-05-06T09:01:52Z","https://github.com/nuxt/nuxt/issues/32000",0.67979425,{"description":3134,"labels":3135,"number":3141,"owner":3027,"repository":3027,"state":3067,"title":3142,"updated_at":3143,"url":3144,"score":3145},"### Environment\n\n- Operating System: `Linux`\r\n- Node Version: `v16.16.0`\r\n- Nuxt Version: `3.2.0`\r\n- Nitro Version: `2.2.1`\r\n- Package Manager: `yarn@1.22.19`\r\n- Builder: `vite`\r\n- User Config: `runtimeConfig`, `css`, `app`\r\n- Runtime Modules: `-`\r\n- Build Modules: `-`\r\n\n\n### Reproduction\n\nSend formData multipart with file to server api (ssr)\r\nthen try to send this formData to external api\r\n\r\n\n\n### Describe the bug\n\nWe don't know how to pass the file or the multipatr form to external api\r\n\r\nform example send file to api, retrieve it and send it\r\n\r\n\n\n### Additional context\n\nwe try with readBody (no file retrieved)\r\nwe try const form = await readMultipartFormData(event); but result is in json or in incomvenant format\r\n\r\nfront call :\r\n\r\n```\r\nasync function submit(values: any) {\r\n\tconsole.debug(values);\r\n\r\n\tif (values.bot !== \"\") {\r\n\t\tsuccessMessage.value = \"\";\r\n\t\terrorMessage.value = \"Form is invalid\";\r\n\t} else {\r\n\r\n\t\tlet jobApplicationDTO = {\r\n\t\t\tfirstName: values.firstName,\r\n\t\t\tlastName: values.lastName,\r\n\t\t\temail: values.email,\r\n\t\t\tphoneNumber: values.phoneNumber,\r\n\t\t\tcompany: values.company,\r\n\t\t\tshortDescription: values.shortDescription\r\n\t\t};\r\n\r\n\t\tconst formData = new FormData();\r\n\r\n\t\tformData.append(\"application\", new Blob([JSON.stringify(jobApplicationDTO)], {type: \"application/json\"}));\r\n\t\tformData.append(\"file\", values.file );\r\n\t\tawait useFetch(\"/api/application\", {\r\n\t\t\tmethod: \"POST\",\r\n\t\t\t//headers: { 'Content-Type': 'multipart/form-data' },\r\n\t\t\tbody: formData,\r\n\t\t\tonResponse({request, response, options}) {\r\n\t\t\t\t// Process the response data\r\n\t\t\t\tif (response.status === 200) {\r\n\t\t\t\t\terrorMessage.value = \"\";\r\n\t\t\t\t\tsuccessMessage.value = \"Your application wa sent successfully, you will be contacted soon !\";\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonResponseError({request, response, options}) {\r\n\t\t\t\tconsole.debug(response);\r\n\t\t\t\tif (response.status === 400) {\r\n\t\t\t\t\tsuccessMessage.value = \"\";\r\n\t\t\t\t\terrorMessage.value = \"There may be an issue with our server. Please try again later, or send an email to support@mantiq.com\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsuccessMessage.value = \"\";\r\n\t\t\t\t\terrorMessage.value = \"Sorry we couldn’t send the message, there may be an issue with our server. Please try again later, or send an email to support@mantiq.com\";\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n}\r\n```\r\n\r\nthe server API\r\n\r\n```\r\nexport default defineEventHandler(async (event) => {\r\n\tconst {BACKEND_REST_API, ENQUIRY_TOKEN} = useRuntimeConfig();\r\n\tconst form = await readMultipartFormData(event);\r\n\tconst applicationUrl = BACKEND_REST_API + '/job/apply'\r\n\tconsole.log(\"url used for enquiry rest call :\" + applicationUrl);\r\n\tconsole.log(\"Job application token :\" + ENQUIRY_TOKEN);\r\n\r\n\treturn await $fetch(applicationUrl, {\r\n\t\tmethod: \"POST\",\r\n\t\tbody: form,\r\n\t\theaders: {\r\n\t\t\t//'Content-Type': 'multipart/form-data',\r\n\t\t\tAuthorization: ENQUIRY_TOKEN,\r\n\t\t},\r\n\t});\r\n})\r\n\r\n```\n\n### Logs\n\n```shell-script\nError 415 fron our backend server media not suppported\r\n\r\n\r\nform log ( i think format is not goog because is array)\r\n\r\n[ 15:22:55\r\n {\r\n name: 'application',\r\n filename: 'blob',\r\n type: 'application/json',\r\n data: \u003CBuffer 7b 22 66 69 72 73 74 4e 61 6d 65 22 3a 22 63 79 72 69 6c 22 2c 22 6c 61 73 74 4e 61 6d 65 22 3a 22 6c 65 63 6c 65 72 63 22 2c 22 65 6d 61 69 6c 22 3a ... 76 more bytes>\r\n },\r\n {\r\n name: 'file',\r\n filename: 'ETIQUETTE MUSC TAHARA PREMIUM 30GR recto.pdf',\r\n type: 'application/pdf',\r\n data: \u003CBuffer 7b 7d>\r\n }\r\n]\n```\n",[3136,3137,3138],{"name":3089,"color":3090},{"name":3063,"color":3076},{"name":3139,"color":3140},"⛔️ can be closed","484893",18945,"Get formData in server api from front call and send it as it is to external API","2023-07-18T20:49:15Z","https://github.com/nuxt/nuxt/issues/18945",0.69720304,{"description":3147,"labels":3148,"number":3150,"owner":3027,"repository":3151,"state":3067,"title":3152,"updated_at":3153,"url":3154,"score":3155},"### 🐛 The bug\n\nUsing proxy from `useScriptClarity` to accept/decline consent doesn't work. The consent updates only after reloading the page (when using cookies/local storage instead of simple refs in useConsent file). When I tried using `window.clarity`, Clarity cookies update as expected.\n\n### 🛠️ To reproduce\n\nhttps://stackblitz.com/edit/nuxt-starter-cohqlgef?file=nuxt.config.ts\n\n### 🌈 Expected behavior\n\nCookies should update as expected.\n\n### ℹ️ Additional context\n\nInstead of viewing the preview window in StackBlitz use this link - https://nuxtstartercohqlgef-ptbs--3000--33edf5bb.local-credentialless.webcontainer.io. It seems cookies don't work in StackBlitz at all.\n\nMaybe I'm using the `useScriptClarity` composable wrong, but I'm not sure.",[3149],{"name":3114,"color":3115},442,"scripts","Clarity proxy not working","2025-04-16T08:12:32Z","https://github.com/nuxt/scripts/issues/442",0.7010269,["Reactive",3157],{},["Set"],["ShallowReactive",3160],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fSZ7iPasoKfSOosEwfVVTQgYctJYfCJUiolUbatO9lA0":-1},"/nuxt/nuxt.com/539"]