diff --git a/controller/upload_file.rst b/controller/upload_file.rst index 886c772d98a..2d6ad260491 100644 --- a/controller/upload_file.rst +++ b/controller/upload_file.rst @@ -222,9 +222,13 @@ You can use the following code to link to the PDF brochure of a product: use Symfony\Component\HttpFoundation\File\File; // ... - $product->setBrochureFilename( - new File($this->getParameter('brochures_directory').'/'.$product->getBrochureFilename()) - ); + if (!$form->isSubmitted() && $product->getBrochureFilename()) { + $form->setData(['brochure' => new File($this->getParameter('brochures_directory').'/'.$product->getBrochureFilename())]); + } + + if ($form->isSubmitted() && $form->isValid()) { + // ... + } Creating an Uploader Service ---------------------------- pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy