How to specify file name with user id

nams09 03 Jul, 2017
Hello!

I'm not sure if this question has been posted before, but I couldn't find anything related.

I have an upload file action in chronoforms and I'd like the name of the file to contain the date and the id of the user that uploads it, can I do this with the "File name provider" option?

Thanks!πŸ™‚
Max_admin 03 Jul, 2017
Hi nams,

yes, you need to use the file name provider, how do you want the file to be named exactly ?

You could use this:

{user:id}-{date:YmdHis}.{var:upload_action_name.file.extension}

Replace "upload_action_name" with the name of the upload action.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
nams09 05 Jul, 2017
Thanks Max, I think that's what I need but I haven't been able to test i because my uploads aren't working.

If I'm trying to save data in CCv6 using a form I made in CFv6 and I have an upload action, do I need any special configuration? Everything saves to the database but my files aren't uploading😟
Max_admin 15 Jul, 2017
Hi nams09,

it depends on your setup, if the fields and upload are handled by Chronoforms but not Connectivity then there is a setting to manage the upload automatically, assuming you have the latest version.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
nams09 29 Jul, 2017
Thanks Max. I'm still having problems with the uploads, I'll see if I can explain myself:

I have three fields which are called actanacimiento, constancia, boleta. So I need the names of the uploads to be <id>_<date>_actanacimiento.pdf, <id>_<date>_constancia.pdf, <id>_<date>_boleta.pdf or whatever the extension is.

I have three upload actions for each, but when I try to upload them it seems that only the first upload action works because I got two of the files uploaded but they're all called <id>_<date>_actanacimiento.pdf and <id>_<date>_actanacimiento.png

So, the only way I figured this was happening was because I uploaded different types of files.

Is this happening because I need to specify which upload action belongs to each field somehow?
Max_admin 29 Jul, 2017
Hi nams09,

Only one upload action is needed in this situation, and in the file name provider you can use:
{user:id}_{date:YmdHis}_{var:upload_action_name.file.name}_{var:upload_action_name.file.extension}


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
nams09 30 Jul, 2017
Thank you so much Max! It's now working perfectly, but on chronoforms.

Now, my problem is I have a New button on Chronoconnectivity which is linked to this form, I used {chronoform/section:formatobecashijos/one} in the content field, it saves everything on the database except for the file names I gave them through the file name provider and it's not uploading them to the server either.

I have a save to database action in chronoforms, but how do I get Chronoconnectivity to save the form? I attached the configuration I have for the new button and where I call the form.

I really appreciate your help!πŸ™‚
Max_admin 30 Jul, 2017
Hi nams09,

You display the Chronoforms section in your Connectivity form, but how do you process the form in Connectivity ? its pointed to the "edit" event, then what do you have in that event ? I suggest that you use Chronoforms to build the form interface only and use Connectivity for everything else, I mean for saving, uploading..etc, it has the same action configuration and features.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
nams09 31 Jul, 2017
1 Likes
It is working now, I added the upload function to the save event and everything works. Thank you so much Max, I'm still getting the hang of the new version but I think I'm getting there!πŸ™‚
simonebno1 07 May, 2018
I need this command for php 7 because {var: upload_action_name.file.extension} and {var: upload_action_name.file.extension} are not working.
GreyHead 07 May, 2018
Hi simonebno1 ,
​
Please drag a Debugger action into the On Submit event, then submit the form and post the debug results here.
​
Bob
This topic is locked and no more replies can be posted.