Component Image Upload - using forms #8229
-
I'm trying to create a component that allows for uploading an image and write to the filesystem called This repo I attempt to create a workable component is here (edited so has all examples):
But get this error when it attempts to post I'm kept the original route |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I changed the repo https://github.com/half-metal/image-upload , and tried using API Post with route |
Beta Was this translation helpful? Give feedback.
-
Figured it out and updated repo https://github.com/half-metal/image-upload I was having trouble with two items
This does what I wanted, although confused why Sveltekit navigates to the action page. |
Beta Was this translation helpful? Give feedback.
Figured it out and updated repo https://github.com/half-metal/image-upload
I was having trouble with two items
"new Response"
for some reason<form method="post" enctype="multipart/form-data" action="upload-image">
where the action is using the api, and including the enctype
This does what I wanted, although confused why Sveltekit navigates to the action page.