Forums

cc5 don't upload file in edit action

fedesimo 13 Sep, 2014
hi,

in edit action i load form created with cf v5 using your tutorial...
if i want to modify an image from form it don't work. in cf i have also put into "on submit" area "file upload" before "connection action" , but it don't work at the same...someone can help me please?

thank's
Max_admin 13 Sep, 2014
1 Likes
Please make a form copy, remove the "connection action" then test the form, make sure the upload works in this case.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
fedesimo 13 Sep, 2014

Hello fedesimo,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How can I edit uploaded files in a form?
P.S: I'm just an automated service๐Ÿ˜‰



unfortunately does not work ๐Ÿ˜Ÿ
fedesimo 13 Sep, 2014

Please make a form copy, remove the "connection action" then test the form, make sure the upload works in this case.

Regards,
Max



this solution does not work. I have another form that works and use it directly from the menu item ...
are the following settings correct?
Max_admin 14 Sep, 2014
Ok, mod[foto] will not work as a file name, please try mod.foto instead, if this doesn't work then you will need to name your upload field "foto", and use that for upload, then use a custom code action after the upload to copy the field name value under mod[foto]:

<?php
$form->data["mod"]["foto"] = $form->data["foto"];
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
fedesimo 14 Sep, 2014
hi admin,
thank's for help but...don't work. ๐Ÿ˜Ÿ

I also thought to enter the code before the "file upload" like this:

<?php
$form->data["foto"] = $form->data["mod"]["foto"];
?>

in both ways it dont't save even the file name into db...
do you think i'd delete everything and rebuild all?
tell me no...please ๐Ÿ˜€
Max_admin 16 Sep, 2014
There is no need to delete everything, this would not solve the issue!

Why did you reverse the code order ? please use my code in a custom code action under the files upload and before the connection action, if it doesn't work then please add a debugger action after the custom code and delete the "connection action" for testing, send me the debug report!

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
fedesimo 16 Sep, 2014
hi,

i made the changes has you told me...here is the debug

i reversed your code and put it before "files upload" (after i've tried your code) because i've thougth that the form "take " mod[foto] and file upload "foto"...

thanks for all.
Max_admin 16 Sep, 2014
Answer
Did you change the file field name to "foto" only instead of "mod[foto]" ? this should be done in the field settings and the upload action settings!

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
fedesimo 16 Sep, 2014
great! now works.

thank's so much, max.
fedesimo 03 Oct, 2014
hi max, i've another problem....
this is an edit form where the users can change the fields value in the record but if they change one or some fields, when submit the field "foto" disappear. into db the field "foto" take an empty value....how can i do?

thank's for all.
Max_admin 06 Oct, 2014
Before the "Connection action" in the "submit" event, you need to unset the "foto" field, or the connection thinks that you want to change it to an empty value, just drag a "custom code" action above the "connection action" and use this code:


<?php
if(empty($form->data["Model"]["foto"])){
unset($form->data["Model"]["foto"]);
}


Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
fedesimo 06 Oct, 2014
great!!! thank you very much, max.
This topic is locked and no more replies can be posted.