Multi uploading files to a folder by name of the text box

How to upload files to a dynamically named folder based on a form text field in ChronoForms.

Overview

The issue occurs because the file upload action only allows a static upload path, preventing the creation of a folder named from a user's text input.
Place a Custom Code action before the Files Upload action in the form wizard. In the custom code, set the upload_path to use the value from the text field to dynamically create the folder path.

Answered
Gu Gugo 13 Dec, 2016
I looked on the forum threads, there is information only on an arbitrary name of uploaded files or attach to email.
My problem is as follows. In the form the user fills in the text box and sequentially loads the different files. However, the file field allows you to specify only the static path upload. Please help us to realize that at the push of a button create a folder by name in the text box and the files is loaded into it.
Translated by Google. Sorry and thanks.

Multi uploading files to a folder by name of the text box image 1
1090x629(59.13 kB)


Multi uploading files to a folder by name of the text box image 2
1090x596(61.22 kB)


Multi uploading files to a folder by name of the text box image 3
910x623(27.44 kB)
Gr GreyHead 13 Dec, 2016
Hi Gugo,

Please see this FAQ. This is a CFv4 FAQ but should, I think, work OK with CFv5.

Bob
Gu Gugo 14 Dec, 2016
Hi GreyHead,
I read the FAQ, you specified earlier, tried to deal with it, but it did not work.
And now, having studied the details did not work. As for instructions before upload_file the posted custom code v.5:
<?php
$user = JFactory::getUser();
$form->actions_config[77]["upload_path"] = "FULL_PATH_TO_FILE".DS.$user->get('username').DS;
?>

Instead of 77, I wrote a number 4 (action in the Wizard, the screenshot above).
Instead of "FULL_PATH_TO_FILE", I wrote a "D:\ServerWebNew\OpenServer\domains\MySite.com" my path.
But a feeling that this code bypasses.

Multi uploading files to a folder by name of the text box image 4
957x2322(68.71 kB)


[attachment=0]2016-12-14_123931.jpg[/attachment]
Gu Gugo 14 Dec, 2016
Whichever path nor have, it is still loads to the default folder
Gr GreyHead 14 Dec, 2016
1 Likes
Hi Gugo,

In your screenshot the id of the Files Upload action is 1 (not 4) and the Custom Code action needs to be before the Files Upload action.

Bob
Gu Gugo 14 Dec, 2016
Answer
1 Likes
my problem was that I took ID number of upload field from a wizard, but it was necessary from settings. According to your instruction has corrected an error. Also has added a code.
<?php
$form->actions_config[1]["upload_path"] =JPATH_SITE.DS.$form->data('text1').DS;
?>

Everything began to work according to a task. It is possible to specify the name of the created folder in a text field and files are uploaded into it.
Many thanks, GreyHead and support FAQ.
This topic is locked and no more replies can be posted.