Forums

Struggling with multi file upload

moggster 02 May, 2015
Configured single file upload fine. works a treat. ๐Ÿ˜›

changed config to multi and added the old [] into the field name as per instruction.

processed the form; I can see files being transferred from browser but not saving to the server. ๐Ÿ˜ข


am I missing something?
moggster 02 May, 2015
thanks but I have seen those two posts and they don't have a definitive answer for V5
GreyHead 03 May, 2015
Hi moggster,

With a bit of experimentation I think I got this to work. Here are the settings I used:

In the Designer tab

+ add the File Field elements and give them each an array name e.g. file_upload[] (and unique ids e.g. file_upload_1).

+ Set the Multiple setting to Yes in each of them

In the Setup tab File Upload action

+ Set the Files config as for a 'normal' upload with no [] e.g. file_upload:jpg-png-pdf-docx

+ Scroll down to the Array Fields box and add the element names e.g. file_upload

If you want to attach them to an Email put file_upload in the Attachments box

Save and test.

Bob
roed 04 May, 2015
Hi Bob,
Just to be perfectly clear: Does this mean that I have to put in 5 unique file fields if I want the option fo 5 files to be uploaded in the form?
GreyHead 04 May, 2015
Hi roed,

To upload five files - yes you do have to have five File Field elements in your form. You can add them individually or using a Multiplier Container if you want that flexibility.

There are jQuery extensions like DropZone that will let you drag and drop files for uploading but so far I haven't been able to get that one to talk to ChronoForms.

Bob
Fredolino 03 Jan, 2016
Hello there,
I tested it with CS5. But it did not work. The photo will be uploaded but the 3 PDF files I do not find as links in the database.
This message I get after onsubmit (screen).
Is a new knowledge to this article?

F.
GreyHead 04 Jan, 2016
Hi Fredolino,

As you can see the data is available (though the array structure is not the best). You don't say how you are formatting this for saving so there isn't anything useful I can say.

Bob
mike_dcx 25 Feb, 2016
Hi GreyHead

I have a little problem, and i think its similar to @fredolino.

I configured successfull 2 multi upload files (i think so), even the files is now in the server, but i canยดt understand why not save any record in the DB....

The debug is:

In Data Array
Array
(
    [option] => com_chronoforms5
    [chronoform] => MultiSet
    [event] => submit
    [button3] => Submit
    [archivo1] => Array
        (
            [0] => 20160225124822_15_-_1.jpg
            [1] => 20160225124822_3IAiR.png
        )

    [id] => 4
)
)


Array
(
    [archivo1] => Array
        (
            [0] => Array
                (
                    [name] => 20160225124822_15_-_1.jpg
                    [original_name] => 15_-_1.jpg
                    [path] => .../components/com_chronoforms5/chronoforms/uploads/MultiSet/20160225124822_15_-_1.jpg
                    [size] => 16725
                    [link] => http://www.---com/omponents/com_chronoforms5/chronoforms/uploads/MultiSet/20160225124822_15_-_1.jpg
                )

            [1] => Array
                (
                    [name] => 20160225124822_3IAiR.png
                    [original_name] => 3IAiR.png
                    [path] => .../components/com_chronoforms5/chronoforms/uploads/MultiSet/20160225124822_3IAiR.png
                    [size] => 28366
                    [link] => .../components/com_chronoforms5/chronoforms/uploads/MultiSet/20160225124822_3IAiR.png
                )

        )

)


and in the Errors section this is what appears:

Array
(
)

In Debug Info:

Array
(
    [1] => Array
        (
            [Files Upload] => Array
                (
                    [0] => Upload routine started for file upload by : archivo1
                    [1] => .../components/com_chronoforms5/chronoforms/uploads/MultiSet/20160225124822_15_-_1.jpg has been uploaded successfully.
                    [2] => Upload routine started for file upload by : archivo1
                    [3] => .../components/com_chronoforms5/chronoforms/uploads/MultiSet/20160225124822_3IAiR.png has been uploaded successfully.
                )

        )

    [8] => Array
        (
            [DB Save] => Array
                (
                    [Queries] => Array
                        (
                            [0] => INSERT INTO `cad_MultiSet` (`button3`, `user_id`, `uniq_id`, `created`) values ('Submit', '0', '416afeba988b22144b7d20ab9b4b375165b49862', '2016-02-25 12:48:22');
                        )

                )

        )

)



Thanks for help!!!...

Pt.. Sorry for my english XD
GreyHead 26 Feb, 2016
Hi mike_dcx,

What do you want to save in the database and in what format? You can save a lit of file names, or filenames in separate columns (up to a point) or use two tables using the second one for the file info.

The immediate problem is that (a) the archivo1 data is an array and won't save in that format and (b) I'm guessing that you don't have an archivo1 column in the database table.

Bob
This topic is locked and no more replies can be posted.