mother / react-files

A file input (dropzone) management component for React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No upload capability?

BHouwens opened this issue · comments

commented

Great project and super easy to use, only there seems to be no way to upload the file data in a post to a server? This makes it nice for a simple demo but useless for anything remotely more complicated. Could potentially benefit from an included FileReader in the upload functions?

Thanks @BHouwens. To keep this library nice and simple, it does not handle file uploading on it's own, since there would be a fair amount of bloat that would come up with this (relating to handling AJAX calls, form parsing, etc). That being said, this library should be very easy to integrate with your app and your favourite form and AJAX client libraries.

I've added some more meat to the demo in order to demonstrate one straightforward approach to how files can be sent from the client to the server. See here:

1edffea#diff-519f0a39b275e6312a6fde9a1f2fc787R36

If you're interested, I've even added some server-side code that processes the file uploads:

1edffea#diff-78c12f5adc1848d13b1c6f07055d996eR37

Hope that helps.

Closing via 1edffea