ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

Files Paths of Attachments in Multiplier Array

wibadd 02 Feb, 2019
I have been able to get the multiplier to work and successfully upload multiple attachments, and the debugger output is showing they array info correctly. I've followed the FAQ at https://www.chronoengine.com/faqs/70-chronoforms/cfv5/5245-how-can-i-use-the-multiplier-in-cfv5 and used {repeater:attachment}{name}{/repeater} but the values are not outputting in my custom code page or email. I can build the link if I'm not able to access it in the file array, but I at least need to get the name. I've also seen an alternate way to build the link to attach files - https://www.chronoengine.com/faqs/70-chronoforms/cfv5/5224-how-can-i-attach-files-from-my-server-to-an-email-in-cfv5, but I'm not entirely sure how to loop that through a multiplier array. Thanks in advance!
Debugger.png
Max_admin 05 Feb, 2019
Hi wibadd,

In v5 the easiest way to do this is using PHP code, you can use the code below to print all the data in the form->data array:
pr($form->data);

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
wibadd 05 Feb, 2019
Understood, however, that gives me no control over what and how it is presented to the user. I need to be able to either attach or provide only the link to the file(s) on the server. Pr just dumps everything to the screen, which is why I was hoping to use the repeater. Any other suggestions on how to do this since the repeater doesn‘t appear to work?

Thanks,
Chad
healyhatman 05 Feb, 2019
That was just to show you the data array so you can see the path you need to take to get to the data you want. So you'd end up with $form->data["files"] for example
wibadd 05 Feb, 2019
Here is the output, as expected, which has the file names concatenated in the same data element. How do I parse this out to either attach or build the links to include in the emails?pr-data_result.png
wibadd 05 Feb, 2019
Answer
1 Likes
I finally figured out I needed to exclude it from the Handle Arrays action, then I could loop through the array and grab the values to build the strings using this:

foreach ($form->data['attachment'] as $k => $v) {
Max_admin 05 Feb, 2019
1 Likes
Great, and if its an option for you, you can download and install v6 as a new extension and build that form on v6 which has more control over the data.

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com