Skip to content
Discussion options

You must be logged in to vote

Remix has split up form data parsing into a pipeline. unstable_createFileUploadHandler() only handles file data. You still need to use unstable_createMemoryUploadHandler() to get the rest. You combine upload handlers via unstable_composeUploadHandlers()

export const action = async ({ request }: ActionArgs) => {

  const uploadHandler = unstable_composeUploadHandlers(
    // handle file uploads
    unstable_createFileUploadHandler({
        directory: './public/uploads',
        file: ({ filename }) => filename
    }),
    // fallback to memory for everything else
    unstable_createMemoryUploadHandler()
  );

  const formData = await unstable_parseMultipartFormData(
    request,
    uploa…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by micahblu
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants
Converted from issue

This discussion was converted from issue #6574 on June 08, 2023 20:28.