What documention for File upload?
- kevin.waterson@gmail.com
- Member | 81
What docs are there that show the processing of file upload?
I have created the form using the docs at https://doc.nette.org/en/forms
And I can see the API at https://api.nette.org/…eUpload.html
But, how do I access the API to process the form?
Eg:
<?php
$form->addUpload('hero', 'Hero Image:')
->setRequired('Please select a Hero Image.')
->addRule(Form::IMAGE, 'Thumbnail must be JPEG, PNG or GIF')
->addRule(Form::MAX_FILE_SIZE, 'Maximum file size is 1Mb.', 1024 * 1024);
?>
So, in the formSucceed function, how is the hero image accessed?
- kevin.waterson@gmail.com
- Member | 81
Close, but put me on the right path.
The bdump you suggest produces an error.
Error
Cannot use object of type stdClass as array
The information is found in $value->hero.
Thanks for the direction
>
Do you think this?
$form->onSuccess[] = function (Form $form, array $values): void { bdump($values['hero']); };