I read in the FAQs that to access the names of uploaded files, I should use the variable $attachments. I have a form where users can upload multiple files, the upload fields have names and ids of 'file_0', 'file_1', and so on. Then in the onSubmit PHP code, I try calling the variables $attachments['file_0'], $attachments['file_1'], and so on, but it doesn't work. I tried entering the line if (isset($attachments)) { echo "YES"; } and nothing was echoed, so the $attachments variable isn't present at all. I have the latest version of Chronoforms, has the $attachments variable been deprecated? How do I get the names of uploaded forms? Thanks.
Hi ContrastCo,
here is how you get it:
Regards,
Max
here is how you get it:
$MyUploads =& CFUploads::getInstance($MyForm->formrow->id);
$attachments = $MyUploads->attachments;
Regards,
Max
This topic is locked and no more replies can be posted.