pqina / svelte-filepond

🔌 A handy FilePond adapter component for Svelte
MIT License
247 stars 10 forks source link

How can i get the return from +server? #20

Open bbauti opened 1 year ago

bbauti commented 1 year ago

Hi! when i submit a file, i want to get, for example, the string 'hey' from the return { text: 'hey'}; return from the +page.server.js in svelte. But i dont know how can i do that, with vanilla forms i got it with $: text= form?.text; But with filepond it wont work.

Randomblock1 commented 1 year ago

This has nothing to do with the plugin itself. You should ask this question on StackOverflow if you need extra help. But here's how you use POST data in SvelteKit:

https://kit.svelte.dev/docs/form-actions#anatomy-of-an-action

The reason why the thing you did worked was because it directly got the raw data right from the form on the client, whereas you probably want to send it and get server-processed data back using a POST request.