Hi guys,
I have another question.
I have a form which posts multiple values to the database for people, part example of array here:
(the form is much more complicated than this but I think this is the only part necessary here)
If I want to upload an image to one of the records in this array I would normally make a file field with a name like:
peoplelist[3][peopleimage]
but in the file upload action I don't think I can use this in the files config box? It doesn't work for me anyway.
So how would I upload a file to a specific record?
I also need to be able to add new records to this table at the same time so would need something like this to work:
(the other fields already work, its the file upload I am struggling to get working)
peoplelist[4][peopleimage] - to store the next record?
I am gathering that I may need to write a custom bit of code?
Any help and advice is much appreciated as usual!
Regards
Mark
I have another question.
I have a form which posts multiple values to the database for people, part example of array here:
(the form is much more complicated than this but I think this is the only part necessary here)
[peoplelist] => Array
(
[0] => Array
(
[peoplename] => starry star1
[peoplemessage] => starry star1
[uniq_id] => 7fbd0bef879952b60810d42b0ed555f301193390
[id] => 9
[peopleimage] =>
)
[1] => Array
(
[peoplename] => SAMMY1
[peoplemessage] => 7777777777777
[uniq_id] => a8f442fb291127a89e16a58c8309a646a8b8816c
[id] => 10
[peopleimage] =>
)
[2] => Array
(
[peoplename] => Steven 1
[peoplemessage] =>
[uniq_id] => 34946c66c1a6a899eeea7cc61b3641d9336bdbbd
[id] => 11
[peopleimage] =>
)
[3] => Array
(
[peoplename] => Maria 9
[peoplemessage] => 222222 22222
[uniq_id] => 79473d3c86f0f2bdf8523b98e005e07d42559c0b
[id] => 12
[peopleimage] =>
)
If I want to upload an image to one of the records in this array I would normally make a file field with a name like:
peoplelist[3][peopleimage]
but in the file upload action I don't think I can use this in the files config box? It doesn't work for me anyway.
So how would I upload a file to a specific record?
I also need to be able to add new records to this table at the same time so would need something like this to work:
(the other fields already work, its the file upload I am struggling to get working)
peoplelist[4][peopleimage] - to store the next record?
I am gathering that I may need to write a custom bit of code?
Any help and advice is much appreciated as usual!
Regards
Mark
Hello ctrlmedia,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
Multiple file uploads from an iPad/iPhone don't work
How do I use the Multi File Upload widget?
P.S: I'm just an automated service😉
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
Multiple file uploads from an iPad/iPhone don't work
How do I use the Multi File Upload widget?
P.S: I'm just an automated service😉
I'm afraid the links supplied by the automated service calculus00 were not helpful in my case!
Regards
Mark
Regards
Mark
Hi Mark,
The easiest way to solve this is to use a plain field name like "field1", "field2"..etc and upload the files then use a custom code action after the upload to copy the values you need under the data path you like.
Regards,
Max
The easiest way to solve this is to use a plain field name like "field1", "field2"..etc and upload the files then use a custom code action after the upload to copy the values you need under the data path you like.
Regards,
Max
Hi Max,
That's exactly what I did. For anyone else interested, name the fields something basic like peopleimage0, peopleimage1 etc and then add some custom code in the submit area to put the contents in the array like the following:
Hope it helps.
Regards
Mark
That's exactly what I did. For anyone else interested, name the fields something basic like peopleimage0, peopleimage1 etc and then add some custom code in the submit area to put the contents in the array like the following:
<?php
if ($form->data["peopleimage0"] !=""){
$form->data["peoplelist"]["0"]["peopleimage"] = $form->data["peopleimage0"];
}
if ($form->data["peopleimage4"] !=""){
$form->data["peoplelist"]["1"]["peopleimage"] = $form->data["peopleimage1"];
}
?>
Hope it helps.
Regards
Mark
This topic is locked and no more replies can be posted.