7

I've got a form that needs to have either a 'file' or 'managed_file' type field in it for uploading files via the form. Is there an attribute that can be set on the form item render array that will allow multiple/unlimited files to be uploaded via the one form item?

For example, when you add a new field via the admin UI to a content type, select the 'file' type widget and then in the field settings set the number of values to 'unlimited' - that's the sort of behavior I'm looking for in this file field via the forms API. Thanks in advance for any pointers!

2 Answers 2

4

If you are trying to build this functionality for a custom form using the Forms API, it may not yet be possible. It's documented on Drupal.org to be an issue. See this discussion, the bottom talks about the problems with implementing AHAH with a file field.

2

I use the Plupload form element. Example of implementation can be found at http://drupal.org/node/1647890

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.