Set FileUpload value from another field
how can i set FileUpload value from another field? i'm trying to set an image to FileUpload field but it's not working.
i've got this error: "foreach() argument must be of type array|object, string given." actualy i'm doing it like: $set('image', $imagePath) and it's wrong. how can i do this?
i've got this error: "foreach() argument must be of type array|object, string given." actualy i'm doing it like: $set('image', $imagePath) and it's wrong. how can i do this?
2 Replies
Solution
try
$set('your_file_field', ['new_file.xxx'])
Yes👍 thanks. It's working perfectly.