The $attachments variable is missing

ContrastCo 02 Jul, 2009
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.
Max_admin 04 Jul, 2009
Hi ContrastCo,

here is how you get it:


$MyUploads =& CFUploads::getInstance($MyForm->formrow->id);
$attachments = $MyUploads->attachments;


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.