Multi Upload Widget db save error.

haujo01 20 Dec, 2012
Hi,

I am replacing the file upload with the multi upload widget. The change was easy and my custom code that changes the upload dir worked. the files went into the dir with no problem.

The form had a db save that put the name in a field called name. with the single file upload it worked great. With the multi upload it makes 1 record even if I upload 3 files. The name field is blank. In the debug I see the array name with the file names but nothing in the db and only 1 record not 3.

Any Ideas? I put the debug below.
Array
(
[option] => com_chronoforms
[chronoform] => img_upload
[event] => submit
[Itemid] =>
[id2] => 666
[uid] => 666
[rout] => components/com_chronoforms/uploads/img_upload
[path] => /var/www/html/asg/components/com_chronoforms/uploads/img_upload
[published] => 1
[parent] => 666
[multi_upload_limit_name] => 3
[input_submit_3] => Submit
[e884ca7fe7b128ed9ee021712b099266] => 1
[id] =>
[name] => Array
(
[0] => 20121219113228_p2.jpg
[1] => 20121219113228_p3.jpg
[2] => 20121219113228_p4.jpg
)

[_PLUGINS_] => Array
(
[upload_files] => Array
(
[name] => Array
(
[0] => Array
(
[name] => 20121219113228_p2.jpg
[original_name] => p2.jpg
[path] => /var/www/html/asg/images/properties/images/thumbs/995/20121219113228_p2.jpg
[size] => 4929
[link] => http://192.168.40.128/asg/images/properties/images/thumbs/995/20121219113228_p2.jpg
)

[1] => Array
(
[name] => 20121219113228_p3.jpg
[original_name] => p3.jpg
[path] => /var/www/html/asg/images/properties/images/thumbs/995/20121219113228_p3.jpg
[size] => 3432
[link] => http://192.168.40.128/asg/images/properties/images/thumbs/995/20121219113228_p3.jpg
)

[2] => Array
(
[name] => 20121219113228_p4.jpg
[original_name] => p4.jpg
[path] => /var/www/html/asg/images/properties/images/thumbs/995/20121219113228_p4.jpg
[size] => 11078
[link] => http://192.168.40.128/asg/images/properties/images/thumbs/995/20121219113228_p4.jpg
)

)

)

)

[chronoform_data] => Array
(
[cf_uid] => 403e9e2f37c08ed88e4429a9d79a257e
[cf_created] => 2012-12-19 11:32:28
[cf_created_by] => 0
[cf_ipaddress] => 192.168.40.1
[cf_user_id] => 0
[option] => com_chronoforms
[chronoform] => img_upload
[event] => submit
[Itemid] =>
[id2] => 666
[uid] => 666
[rout] => components/com_chronoforms/uploads/img_upload
[path] => /var/www/html/asg/components/com_chronoforms/uploads/img_upload
[published] => 1
[parent] => 666
[multi_upload_limit_name] => 3
[input_submit_3] => Submit
[e884ca7fe7b128ed9ee021712b099266] => 1
[id] => 1265
[name] => Array
(
[0] => 20121219113228_p2.jpg
[1] => 20121219113228_p3.jpg
[2] => 20121219113228_p4.jpg
)

[_PLUGINS_] => Array
(
[upload_files] => Array
(
[name] => Array
(
[0] => Array
(
[name] => 20121219113228_p2.jpg
[original_name] => p2.jpg
[path] => /var/www/html/asg/images/properties/images/thumbs/995/20121219113228_p2.jpg
[size] => 4929
[link] => http://192.168.40.128/asg/images/properties/images/thumbs/995/20121219113228_p2.jpg
)

[1] => Array
(
[name] => 20121219113228_p3.jpg
[original_name] => p3.jpg
[path] => /var/www/html/asg/images/properties/images/thumbs/995/20121219113228_p3.jpg
[size] => 3432
[link] => http://192.168.40.128/asg/images/properties/images/thumbs/995/20121219113228_p3.jpg
)

[2] => Array
(
[name] => 20121219113228_p4.jpg
[original_name] => p4.jpg
[path] => /var/www/html/asg/images/properties/images/thumbs/995/20121219113228_p4.jpg
[size] => 11078
[link] => http://192.168.40.128/asg/images/properties/images/thumbs/995/20121219113228_p4.jpg
)

)

)

)

)

[chronoform_data_id] => 1265
)
Max_admin 20 Dec, 2012
Hello,

That's normal, you can use a "Handle arrays" action to concatenate the 3 files names into 1 column, or you can save the files names into a new table and associate them to the main record (best practice for later data processing but is more complicated when saving and retrieving data).

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
haujo01 20 Dec, 2012
Max,

Thanks for the info and advice. It is good to know about how it works. Even though I just came across your product I must say it is a great product and well thought out.

For my issue it will be better for me to write to the db with custom code using the form data.
john
This topic is locked and no more replies can be posted.