Hello,
I'm trying to do this:
I have a form with a fileupload element and I want to update two other fields on the form when the form is submited.
the fields are size and extension
i used this code on php plugin of the form onBeforeCalcuation
The problem is that i'm not able to submit the data retrieved to the db using formModel.
Any help is appreciated
Thank you
I'm trying to do this:
I have a form with a fileupload element and I want to update two other fields on the form when the form is submited.
the fields are size and extension
i used this code on php plugin of the form onBeforeCalcuation
PHP:
$filename = ($formModel->formData['file']);
$ext = pathinfo($filename, PATHINFO_EXTENSION);
$file_size = filesize(JPATH_SITE.$filename);
$formModel->updateFormData('document___extension', $ext, true);
$formModel->updateFormData('document___size', $file_size, true);
The problem is that i'm not able to submit the data retrieved to the db using formModel.
Any help is appreciated
Thank you
Last edited: