Save files in different folders

How to save uploaded files into dynamically created subfolders.

Overview

The issue is that all files are being saved into a single directory instead of being organized into separate folders based on form data.
Use the provided PHP filesystem function to create a new directory using a value from the form submission, then configure the upload action to save files into that newly created path.

Answered
ChronoForms v6
bk bkgraf 23 Apr, 2019
Hi, my project need save files, but i need create new folder for by one of the add.

In this moment i save all the archives in one folder.

Example:
/imagenes/picture_avion_1.jpg
/imagenes/picture_avion_2.jpg
/imagenes/picture_avion_3.jpg
/imagenes/picture_avion_4.jpg

The idea is create a folder.
Example:
/imagenes/avion/picture1.jpg
/imagenes/avion/picture2.jpg
/imagenes/avion/picture3.jpg
/imagenes/avion/picture4.jpg

Red Color = New folder with this name.

Can i do create a new folder from Upload?, How can do this?, Is possible?
he healyhatman 24 Apr, 2019
Answer
You can use PHP
JFolder::create(JPATH_ROOT . '/imagenes/' . $this->data("fieldname"));

https://docs.joomla.org/How_to_use_the_filesystem_package
This topic is locked and no more replies can be posted.