Could you post the error message, or a screenshot?
When you hit the submit button and nothing seems to happen, could you please open the “variables” in your lower debug menu and check, if there are validation errors?
Could you post the error message, or a screenshot?
When you hit the submit button and nothing seems to happen, could you please open the “variables” in your lower debug menu and check, if there are validation errors?
could you undo these change?, because I don#t know the behavior of “getUploadedFile” and I work with “getData”
If I change
$image1 = $this->request->getUploadedFile('image1');
back to
$image1 = $this->request->getData('image1');
I get the error message that you can see in the screenshot. If I use getUploadedFile('image1')
instead, I get the following errors in my variables:
‘recipe’ => [
‘image1’ => [
‘scalar’ => ‘The provided value is invalid’,
‘maxLength’ => ‘The provided value is invalid’,
],
],
So I changed the Recipes Table to
$validator
//->scalar('image1')
//->maxLength('image1', 200)
//->allowEmptyFile('image1');
->isArray('image1')
->allowEmptyArray('image1');
and now everything works!