You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My environment [Svelte] --FormData submit--> [SvelteKit Endpoint] --call for save file --> [Rails]
Describe the issue
I uploaded the file and submitted the form to the SvelteKit Endpoint. Then I passed FormData from SvelteKit to Rails by Axios get error "Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream"
Example Code
Code snippet to illustrate your question
[svelte]<form
on:submitmethod="post"enctype="multipart/form-data"action="/api/reports"><Fileuploadname="report[thumbnail]"size="sm"accept="image/png, image/jpeg"/></form>[sveltekitendpoint]exportconstPOST: RequestHandler=async({ request, locals })=>{constform=awaitrequest.formData();// get formDataconstresponse=awaitaxios.post(`${url}`,data)// send form data};
Activity
passakorn-new commentedon Sep 13, 2022
I change node-fetch instead Axios that work!, but i want to use Axios.
lenivene commentedon Sep 16, 2022
I'm having the same problem when sending a file using [email protected] version, but I'm tested on [email protected] version and it worked fine
gbersac commentedon Apr 14, 2023
I'm having the same issue with
"axios": "^1.3.5"