Multiplier File Upload

How to save multiple file upload URLs with a multiplier in ChronoForms.

Overview

The issue occurs when using a multiplier with file upload fields, as the standard approach doesn't automatically save the file links to the database.
Ensure the file field name uses the pattern 'file1[__N__]' and configure it in the files settings. Then, use a custom code action before database save to loop through the uploaded files and assign their link URLs to the correct data array for storage.

Answered
Yu Yudhizth 11 Sep, 2015
Dear all,

How to use multiplier with file upload? and save url of each file upload. I've been success with textbox but not work with fileupload.
Thanks you.
Yu Yudhizth 21 Sep, 2015
Thank you, but that's not help. Sorry ๐Ÿ˜ข
Yu Yudhizth 21 Sep, 2015
I found a clue, I change field name to file1[__N__] and put file1 on files config. So, when I submit the form. It show that file has been uploaded successfully. But I still have a problem with save the link of the file. I put this code on custom code before db save.
<?php
foreach ($form->data["fileupload"] as $k => $v) {
  $form->data["fileupload"][$k]["file1"] = $form->files["file1"][$k]["link"];
}
?>


It's doesn't work๐Ÿ˜Ÿ
On db save i put fileupload as model id. Maybe I miss something?
Thank you.
Yu Yudhizth 21 Sep, 2015
Answer
Okey, I fix this ๐Ÿ˜€ this is the final code
<?php
foreach ($form->data["file1"] as $k => $v) {
  $form->data["fileupload"][$k]["file1"] = $form->files["file1"][$k]["link"];
  $form->data["fileupload"][$k]["id_permohonan"] = $form->data["id_permohonan"];
}
?>
This topic is locked and no more replies can be posted.