src/Component/Frontend/StructureModal/StructureModal.php
public function successFile(Form $form) : void
    {
        if ($this->presenter->isAjax() && $this->presenter->user->isAllowed(StructureAuthorizator::RES_STRUCTURE_MODAL))
        {
            $recipeSlug = $this->getRecipeSlug();
            $structure = $this->getStructure();

            foreach ($form->getValues() as $recipeVariableSlug => $files)
            {
                $recipeVariable = $this->recipeVariableRepository->findOneByRecipeSlug($recipeSlug->getRecipe(), $recipeVariableSlug);
                $structureValue = $this->structureValueRepository->findOneByStructureAndVariableSlug($structure, $recipeVariableSlug);

                try
                {
                    if (!$structureValue)
                    {
                        $structureValue = $this->structureValueManager->createEmptyVariable($structure, $recipeVariable);
                    }

                    /** @var FileUpload $file */
                    foreach ($files as $file)
                    {
                        $this->structureValueFileManager->add($structureValue, $file);

                        $this->presenter->notificationAjax(
                            'Soubor nahrán',
                            "Soubor '{$file->getName()}' byl úspěšně nahrán.",
                            'success',
                            FALSE
                        );
                    }

                    // Reset rules
                    $component = $this->IVariableFormBuilder->buildComponent($recipeSlug->getRecipe(), $recipeVariable, $structure, $structureValue);
                    /** @var UploadControl $component */
                    $form->removeComponent($form->getComponent($recipeVariableSlug));
                    $form->addComponent($component, $recipeVariableSlug);

                }
                catch (\Exception $exception)
                {
                    $this->presenter->notificationAjax(
                        'Chyba při nahrávání',
                        "Soubor '{$file->getName()}' se nepodařilo nahrát. Chyba: {$exception->getMessage()}",
                        'error',
                        FALSE
                    );
                }
            }

            $this->onSaveFile();
        }
    }
public function successFile(Form $form) : void
    {
        if ($this->presenter->isAjax() && $this->presenter->user->isAllowed(StructureAuthorizator::RES_STRUCTURE_MODAL))
        {
            $recipeSlug = $this->getRecipeSlug();
            $structure = $this->getStructure();

            foreach ($form->getValues() as $recipeVariableSlug => $files)
            {
                $recipeVariable = $this->recipeVariableRepository->findOneByRecipeSlug($recipeSlug->getRecipe(), $recipeVariableSlug);
                $structureValue = $this->structureValueRepository->findOneByStructureAndVariableSlug($structure, $recipeVariableSlug);

                try
                {
                    if (!$structureValue)
                    {
                        $structureValue = $this->structureValueManager->createEmptyVariable($structure, $recipeVariable);
                    }

                    /** @var FileUpload $file */
                    foreach ($files as $file)
                    {
                        $this->structureValueFileManager->add($structureValue, $file);

                        $this->presenter->notificationAjax(
                            'Soubor nahrán',
                            "Soubor '{$file->getName()}' byl úspěšně nahrán.",
                            'success',
                            FALSE
                        );
                    }

                    // Reset rules
                    $component = $this->IVariableFormBuilder->buildComponent($recipeSlug->getRecipe(), $recipeVariable, $structure, $structureValue);
                    /** @var UploadControl $component */
                    $form->removeComponent($form->getComponent($recipeVariableSlug));
                    $form->addComponent($component, $recipeVariableSlug);

                }
                catch (\Exception $exception)
                {
                    $this->presenter->notificationAjax(
                        'Chyba při nahrávání',
                        "Soubor '{$file->getName()}' se nepodařilo nahrát. Chyba: {$exception->getMessage()}",
                        'error',
                        FALSE
                    );
                }
            }

            $this->onSaveFile();
        }
    }
Success - file input form
@param Form $form
@throws \Propel\Runtime\Exception\PropelException