Hello Everyone,
I have a form which is used to Edit my entried in Table created previously from users with chronoforms. (Chronoforms V4 User)
The table has an uploaded filename also.
The problem is that if the user (when editing his data) does not upload a file then the filename entry is replaced with blank.
I tried to use some custom code to get it done but with no luck
Here is my code:
I have a form which is used to Edit my entried in Table created previously from users with chronoforms. (Chronoforms V4 User)
The table has an uploaded filename also.
The problem is that if the user (when editing his data) does not upload a file then the filename entry is replaced with blank.
I tried to use some custom code to get it done but with no luck
Here is my code:
<?php
$uploadedfile = $row->data[‘uploadedfile’]; // (I have created a hidden box that gets the filename from the Database Loader Action)
$uploadedfile2 = $row->data[‘uploadedfile2’]; // (I have placed this after the upload files action
If ($uploadedfile2 != NULL){
$row->data[‘uploadedfile’] = $uploadedfile2;
}
?>
Hello hellykun,
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?
How can I add a file upload to my form?
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:
How can I edit uploaded files in a form?
How can I add a file upload to my form?
P.S: I'm just an automated service😉
Thanks a lot for your reply.
I have tried the above but it did not work.
The filename gets replaced with blank.
my file is named uploadedfile
the code I used
Am i missing something here?
I have tried the above but it did not work.
The filename gets replaced with blank.
my file is named uploadedfile
the code I used
<?php
$files_array = array(
'uploadedfile'
};
foreach ( $files_array as $v ) {
if ( !$form->data[$v] ) {
unset($form->data[$v]);
}
}
?>
Am i missing something here?
Hi hellykun,
Please try adding Debugger actions so that you can see exactly what is happening. It may be that the sequence of actions isn't right.
Bob
Please try adding Debugger actions so that you can see exactly what is happening. It may be that the sequence of actions isn't right.
Bob
As far as I can understand from the debugger.
The custom code is not executed at all.
The custom code is not executed at all.
The correct sequence should be this:
* Upload files action
* Custom code action with the code above
* DB save action
The debugger may be inserted after the custom code to verify that the uploadedfile field does not exist in the data array when no file is uploaded.
Regards,
Max
* Upload files action
* Custom code action with the code above
* DB save action
The debugger may be inserted after the custom code to verify that the uploadedfile field does not exist in the data array when no file is uploaded.
Regards,
Max
This topic is locked and no more replies can be posted.
