In the +page.svelte
file located at route/manager
, I have a form setup as follows:
<form
id="file_selection"
action="?/manageFile"
method="post"
use:enhance={() => {
waiting = true;
return async ({update, result}) => {
await update();
console.log(result);
}
}}>
<h1>
Please select or drop your <span id="stressed"
>bank statement</span
>.
</h1>
<input type="file" id="fileInput" name="fileInput" bind:files /> -->
<label for="file">
{message}
</label>
<p>Accepted file types: <i>.xlsx</i> ; <i>.csv</i></p>
<button class="cta" type="submit">Continue</button>
</form>
This is my +page.server.ts
script located in the same directory:
import type { Actions } from '@sveltejs/kit';
export const actions: Actions = {
manageFile: async ({ request }) => {
console.log(await request.formData());
}
}
Despite checking everything thoroughly, I keep encountering the
405 POST method not allowed. No actions exist for this page
error.
I've even attempted removing the use:enhance directive without success.
Any assistance would be greatly appreciated as this issue is becoming quite frustrating :/