Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File input? #48

Open
kokujin opened this issue Jan 30, 2013 · 14 comments
Open

File input? #48

kokujin opened this issue Jan 30, 2013 · 14 comments
Assignees

Comments

@kokujin
Copy link

kokujin commented Jan 30, 2013

I know that someone filed an issue about this (#44) Has it been merged? Any news on this? Thanks

@ljharb
Copy link
Collaborator

ljharb commented Jan 30, 2013

https://github.com/caolan/forms/tree/file_input is the branch… it hasn't been merged. I asked the submitter of #44 to test it for me, and they decided not to do so. Please reopen #44, and please test it yourself, if you'd like to see it merged.

@ljharb ljharb closed this as completed Jan 30, 2013
@kokujin
Copy link
Author

kokujin commented Jan 30, 2013

just tested it, it adds this:
"input type="text" name="testfile" id="id_testfile"

. It does not work as expected. How can I reopen this issue?

@ljharb
Copy link
Collaborator

ljharb commented Jan 30, 2013

Thanks! I'll do some more work on it and update this issue. To reopen, there's a green "reopen" button on the bottom - I'll reopen it now.

@ljharb ljharb reopened this Jan 30, 2013
@kokujin
Copy link
Author

kokujin commented Dec 28, 2013

Hi! Any news on this ljharb? Thanks

@ljharb
Copy link
Collaborator

ljharb commented Dec 28, 2013

I haven't had a chance to work on it yet - I've just taken another look, and it's mostly done - I need to make the example work with multipart form data first.

@ghost ghost assigned ljharb Dec 28, 2013
@ljharb
Copy link
Collaborator

ljharb commented Dec 29, 2013

I've updated the file_input branch - it creates the input field just fine, and it helped me to figure out that forms needed to handle multipart submissions. However, forms currently only gets "fields" to validate, not "files" - so this is a very complex feature request that will take awhile to get right.

@RYFN
Copy link
Contributor

RYFN commented Oct 17, 2014

Any progress on this feature?

@danielst-vccp
Copy link

Has anyone found a way to implement this yet?

@voxpelli
Copy link
Contributor

voxpelli commented Jul 8, 2015

@danielst-vccp: I made a custom image uploader field for a project of mine, if you want to have a reference on how one can approach that: https://github.com/voxpelli/node-one-page/blob/9b2f57bbedf68aa54cbe291d1879741a7da28b7a/lib/utils/forms.js#L22-75 It in turn uses https://github.com/mscdex/connect-busboy to handle the uploaded data and pipes that to Cloudinary.

Not sure if I could wrap that up as a more generic PR or how it relates to the mentioned stale branch, but wanted to point out that it is possible to get fields to work with this module today, even if it is less handy than it could be.

@ljharb
Copy link
Collaborator

ljharb commented Jul 9, 2015

@danielst-vccp https://github.com/caolan/forms/compare/file_input is my attempt, but it's not working yet, and I haven't had a chance to work on it in awhile.

@danielst-vccp
Copy link

@voxpelli @ljharb very helpful, will take a look, thanks chaps.

@nervgh
Copy link
Contributor

nervgh commented Apr 28, 2017

@ljharb

https://github.com/caolan/forms/compare/file_input is my attempt, but it's not working yet, and I haven't had a chance to work on it in awhile.

It looks like all tests passed. What did you mean under

it's not working yet

?

@ljharb
Copy link
Collaborator

ljharb commented Apr 28, 2017

The tests for it aren't sufficient (it's nearly impossible to automate testing of a file input).

It doesn't work, meaning if you load up the examples, and try it - it will not successfully validate the file (if I recall; it's been awhile since I've looked at this)

@voxpelli
Copy link
Contributor

My image field is now possible to use as part of: https://github.com/Sydsvenskan/node-forms-utils#fields

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants