cforms II User Forum

Registration is currently disabled.


Login form protected by Login LockDown.

Lost password?
Advanced Search

— Forum Scope —


— Match —


— Forum Options —


Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS Related Topics
How to auto create a directory on form submission with uploaded files in it?
Get all the uploaded files of one submission in one directory
Tags: ***
February 5, 2013
10:30 pm


How can I create a directory and get the uploaded files in it on each form submission? It could be a great feature. The created directory could be named with the name field and the submission date. I guess it could be done via my-functions.php, still looking, if anyone have a good idea…

Thanks in advance for your help.

April 16, 2013
11:54 am

 Hi there,

I've managed to create a sub-directory named with form submitted data (submitted name+date). It goes well, I get a successfull message on form submission. BUT the sub-directory is empty and there are any attachment in the confirmation email.

I guess it's a upload path issue but I don't get it.

Here's my "filedestination" condition in the my-function.php file, I did the same for the ""fileDestinationTrackingPage"" condition:

if ( $setting == "fileDestination" ){


$folder = $_POST['cf_field_5'] . '_' . $_POST['cf_field_4'] . '_' . date('dmYHis');

$newArray = array();
$folderpath = $oldvalue['path'] . '/' . $folder;

if ( !file_exists($folderpath) ) {
mkdir($folderpath, 0755);

$newArray['path'] = $folderpath;
$newArray['modified'] = true;

return $newArray;


Where am I wrong?

April 22, 2013
1:38 pm


April 22, 2013
4:12 pm

Hi people,

I made it work, you have to specify the file name, even if you don't want to change it. So I simply add:

$newArray['name'] = $oldvalue['name'];

And all goes well!!!

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
25 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3763

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5359

Posts: 18742

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)