I planning to save the user submitted file in the civicrm file table. I have tried these code to get the submitted file name, but it doesn't work
function postprocess(){
$file = $this->_submitValues['uploadFile'];
}
Any help would be appreciated!
Update :
This is my code, i can get the title, option value except the uploaded file name.where am i going wrong ??
function buildQuickForm() {
$this->add('text', 'title', ts('Title'),'' ,TRUE);
$this->add('File', 'uploadFile', ts('Upload the file'), TRUE);
$this->add('select', 'option', ts('option'),
array(
'0' => ts('- select -'),
'3' => ts('option 1'),
'4' => ts('option 2')
)
);
$this->addButtons(array(
array(
'type' => 'submit',
'name' => ts('Submit'),
'isDefault' => TRUE,
),
));
}
function postprocess(){
foreach($this->_submitValues as $key => $values){
civi::log()->debug($key);
civi::log()->debug($values);
}
}