Forums

Multiplier File Upload

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.
Yudhizth 21 Sep, 2015
Thank you, but that's not help. Sorry ๐Ÿ˜ข
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.
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.