Cannot get a fileupload element value

smart

Member
Hello,

I have fileupload element on a form and want to get this file name and import its data to mysql table.
Element name is kcsvupload .
Code is added in Start of Form Submission event (onBeforeProcess).

$fileName = $formModel->formData['kcsvupload'];
var_dump($fileName);

CSV file has been uploaded to that record.

I am not getting that variable value (fileName) here.
I also tried $data['tkbcsv___kcsvupload']; and no data as well.

Please help. Thanks
 
Hello!

Check the data being passed by the http request.
use var_dump($_POST) or var_dump($_GET), and check if the file information is arriving the way you are trying to access it.

It would be something like:

var_dump($_POST);
die();


Remembering that you must use POST or GET, and it will depend on the way you are sending it.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top