#FileUpload Remix Component

1 messages · Page 1 of 1 (latest)

floral grove
#

Hey guys, i'm trying to build a component for the Fileupload. The normal Fileupload from Sergiodxa.com is working in my App. But in my Fantasy there is a complete Component, which handels the Action and Loader inside of the component - but i know that a component got no Action or Loader... the next problem is, that i need my formData in the component, cause im adding the files into the formData to recieve the data in my action.

Is there any way or idea how to build a wonderful all in one file upload component?

Thanks for help!

Best regards

Steven

spiral falcon
# floral grove Hey guys, i'm trying to build a component for the Fileupload. The normal Fileupl...

If you’re looking to make just a file upload happen and not attach extra data it would be easiest to just make a form that includes the file upload you want and then open an endpoint action to accept that file upload. Kent has a good mental model for the type of thing you’re interested in and he calls it’s “full stack components”

https://www.epicweb.dev/full-stack-components

Epic Web Dev

There’s this pattern I’ve been using in my apps that has been really helpful to me and I’d like to share it with you all.

#

Maybe that can get your ideas flowing for the type of component you’d like

#

But I think it would not be very straightforward to make a file upload form that takes a bunch of arbitrary other form data fields. That seems a bit more difficult or at least requires a fair amount more branching at which point I’d just recommend opening a different route so each action has a clear and simple “happy path” of execution

floral grove
#

yeah thx buddy, i already looked at the epic stack for some ideas- but in fact they using own routes for the file upload - and im not sure if i like that... but thanks for your response!

spiral falcon
#

Remix is also turning its attention to RSCs but we are probably a few months out from real support

floral grove
#

na its fine man, thank your for your answer, i could not figure out a way in my head either, maybe its because there is no good way for this 🙂

spiral falcon
#

Having tried out the app router with NextJS there’s a lot of pain in application structure currently