How to upload file to a server
Unanswered
Bucovina Shepherd Dog posted this in #help-forum
Bucovina Shepherd DogOP
Hello, I need a server to get a token and a file from a user to verify that the user can post files and then post it.
I tried to do it with server functions in this way
But I get this error
Any way I can prefform what I want in any other way?
I tried to do it with server functions in this way
export async function serverSideBlogSubmit(token: string, content: (string | File | null)[])But I get this error
app-index.js:31 Warning: Only plain objects can be passed to Client Components from Server Components. File objects are not supported.Any way I can prefform what I want in any other way?
7 Replies
Bucovina Shepherd DogOP
I will look into it thanks
You can use this package or read through the code and get an idea of how file uploads are implemented behind the scenes
And copy / modify whatever is needed for your use case
Verification of file uploads is built in
@linesofcode Verification of file uploads is built in
Bucovina Shepherd DogOP
Ooo nice thanks!