Answer the question
In order to leave comments, you need to log in
How to validate the number of files?
* @var File|UploadedFile
*
* @Assert\NotNull()
* @Assert\NotBlank()
* @Assert\Image(
* detectCorrupted=true,
* mimeTypes={"image/png", "image/jpg", "image/jpeg"},
* )
* @Assert\File(
* maxSize="8M",
* )
*/
public $imageFile;
/**
* self constructor.
*
* @param UploadedFile $imageFile
*/
public function __construct(UploadedFile $imageFile)
{
$this->imageFile = $imageFile;
}
$filesMeta = \json_decode($request->request->get('ашдуы'));
foreach ($filesMeta as $imageMetaData) {
...
Warning: Invalid argument supplied for foreach()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question