Setting upload path in custom code

Set a custom upload path in ChronoForms v6.

Overview

The method for setting the upload path via custom code changed from v5 to v6.
Use a PHP action to define a variable containing your path, then reference that variable using a shortcode in the upload action's path field. Ensure the PHP action runs before the upload action.

Answered
ChronoForms v6
st stami 08 Feb, 2018
In chronoforms v5 you changed the path in custom code:

$forms->data_actions_config[]["upload_path"]=path
How do you do that in V6?
Max_admin Max_admin 08 Feb, 2018
Answer
Hi stami,

in v6 you can use shortcodes anywhere, you can set your path inside a var and use it in the path field, for example, you can use this code in PHP action:
$this->set("mypath", "path goes here");
Then use {var:mypath} in the path field, the PHP action should be before the upload action of course.

Best regards
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.