CF8 - File Uploap BUG

Use variables from a previous page in a ChronoForms file upload filename.

Overview

The file upload action runs during field validation before form submission, so variables from earlier pages are not yet available.
Add a "pre submit" action to the beginning of the load area on the page containing the file upload to set the required variables first.

Answered
rb rbock 26 Oct, 2024

Filename Provider: {var:var1}{var:var2}.{file:extension}

what's going wrong?

Reported months ago, by the way!

Max_admin Max_admin 26 Oct, 2024

what is the problem with this ? tell me the expected behavior and the actual behavior, and what happens when you use this:

Filename Provider: file-{var:var1}{var:var2}.{file:extension}

what do you get ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rb rbock 26 Oct, 2024

File NameProvider simply does not accept any values ​​from var ! {var:user.name}

Max_admin Max_admin 26 Oct, 2024
Answer

this is because var is not yet set at this moment, the upload is done with fields validations before any submit action is run

if you need any vars to be set at this point then you need to run them in a "pre submit" action, and this pre submit action should be first thing in the "load" area

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rb rbock 26 Oct, 2024

The variables come from the first page! For example, if I enter one in Placeholder, it is displayed correctly! FileName Provider only seems to accept values ​​from data!

Max_admin Max_admin 26 Oct, 2024

how do you set these variables on the first page ? and where is your file field ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rb rbock 26 Oct, 2024

Page 1 - DB Read Action + Data Merge (Name: TNS)

Page 2 - PHP Action + Event -> File Upload - Filename Provider {var:TN.MYNAME}_{var:TN...}.{file:extension}

Max_admin Max_admin 26 Oct, 2024

so the file field is inside page2 "load" ?

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.