I have civicrm installed with Drupal. I was not able to find how to create a multiple file upload using a civicrm custom data field. By default it allows only single file to be uploaded at a time. I require some 'Add more' type of functionality in CiviCRM.
When you create the Custom Field Set for contacts*, you can check the box that says "Does this Custom Field Set allow multiple records?":
Multiple record fieldsets
By default custom data sets have a 'one-to-one' relationship to the entity they are attached to. For example, one field set for a person's physical attributes which contains one field for their height and one for their eye colour will be attached to one individual record. This makes sense because we only ever need to record one eye colour and one height for each person. However, in certain circumstances, we want to record multiple custom field sets for a single contact, for example, when recording a person's educational history. In this case, a single person may have multiple educational degrees, so a custom field set about educational history, which contains fields for subject, institution, and grade, should allow multiple records, and this is what multiple record fieldsets allow.
You can only add multiple record field sets to contacts - you can't add them to other entities. To use this option, select the "Does this Custom Field Set allow multiple records?" option. A few things to bear in mind when creating mutiple record custom field sets:
- Multiple data applies to the whole field set, not to individual fields.
- Multiple data be can only be added to Contacts. It cannot be added to Activities, or Contributions, etc.
- Mutiple data cannot currently be exported
- Before deciding to model something as a multiple value custom field set, you may wish to consider whether it could or should be modelled as an activity. For example, an educational degree could be an activity with custom data added.
CiviCRM does not have this capability at present, but it could be created for your site.
Using a file field in a repeating fieldset is the only way to add an undetermined number of files to an object in CiviCRM, though there is a configurable maximum number of repetitions. You could also add a set number of file fields that should be sufficient for most use cases. The former will look a bit nicer.
Once you have defined the fields to store the (references to the) uploaded files, you will need to create your own upload page to handle multiple simultaneous uploads. Look for a pre-existing function in jQuery that can do this, or in a different library compatible with the CiviCRM browser technology stack.