How to get a file path value from file upload element

smart

Member
Hello,

JavaScript:
  console.log(this.form.formElements.get('tkbheader___kcsvfile').getValue());

tkbheader___kcsvfile is the file upload button element.

I am not getting the file path. How could I get a path stored there?
 
The path is not stored "there" in that table's record with the file name. The path is stored in the params of the element data.
 
E.g. in calc element you could get the path something like:
Code:
$mydb = JFactory::getDBO();
$mydb->setQuery("SELECT a.params FROM #__fabrik_elements AS a LEFT JOIN #__fabrik_formgroup AS b on a.group_id=b.group_id WHERE b.form_id = '123' AND a.name = 'element_name' ");
$myparams = $mydb->loadResult();

$myobj = json_decode($myparams);
return $myobj->{'ul_directory'};
And of course change the form id and element name in the query.
 
If you don't remember the path you entered when setting up the fileupload element, you could also just very simply look it up in the element settings, then copy & paste or manually type it in where you need it.
 
Last edited:
I apologize here. I missed type up there. Thanks for pointing me out how to get the parameter. I have made you extra explanation. I appreciate it.
I would like to get that csv file name ( which is uploaded) and stored as file name value in the record.
 
I want to upload csv file to our server. Then add the csv data to the mysql table.

I have a file upload element and upload it into one folder under the Joomla root.
On the same form, there will be another button "Merge data into the table". This button will get the csv file name, run a php code to merge the data.
Is there any simple way to do that?
Thanks much :)
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top