dynamic number of file uploads

csdpl 26 May, 2014
Hi,

Was wondering what is the best way to have a chronoform having a dynamic number of file upload fields.

For instance, there is an attachments list table which contains 4 rows, therefore when the said chronoform loads, it will display 4 file upload fields.

By changing the number of rows in the attachmentst list table, the number of file upload fields in the chronoform must change appropriately.

Thanks in advance.
GreyHead 26 May, 2014
Hi csdpl,

I think that you'd have to use Custom Code to do this, firstly to query the database to check the number of rows in the table, then use a PHP loop to create the corresponding number of file upload inputs.

Bob
csdpl 29 May, 2014
Hi,

Ok, if we do go ahead with the custom code based implementation, then a couple of questions that we were not sure how to address:

1. how can we set the file size limit for the file upload, extension type restrictions and folder in which it will be saved (these are the parameters that can be set in the upload files event)

2. If an upload exceeds the file limit, then the "event loop" provided in chronoforms, how do we get the same behaviour

Please advice.
GreyHead 02 Jun, 2014
Hi csdpl,

You can use the standard Upload Files action but in the Files box you need to add settings for the maximum number of file uploads that you are allowing . . . with the matching input names. Any that aren't used will just be ignored.

Bob

PS Might the multi-upload widget give you a solution here?
This topic is locked and no more replies can be posted.