You can try to deal with upload file at form doSave(). It is wired for embedded form with upload file.
but I use the doSave() to deal with, it works, but I don't think it is good solution. Good luck On Jul 4, 4:13 pm, jmaicher <julian.maic...@googlemail.com> wrote: > Hey! > > I've been spending hours and hours to find a way to upload a file in > an embedded form. But I couldn't find a solution yet. :-( > It seems to be a common bug and there is already a ticket (http:// > trac.symfony-project.org/ticket/6662). But I don't use doctrine forms. > I tried everything, including the workaround > onhttp://stereointeractive.com/blog/2008/12/23/symfony-12-upload-a-file.... > Unfortunately with no success. > > Please, do you guys have any suggestions for me?! > > Here is my form: > > class JobForm extends sfForm > { > public function JobForm() > { > ... > $this->embedForm("step2", new JobForm_Step2()); > ... > } > > } > > class JobForm_Step2 extends sfForm > { > > public function configure() > { > ... > > $this->setWidget("image", new sfWidgetFormInputFile()); > > # define validator for image > $configData = sfConfig::get("app_job_image"); > > $this->setValidator("image", new sfValidatorFile(array( > "required" => false, > "path" => sfConfig::get('sf_upload_dir') . $configData > ['upload_dir'] , > "mime_types" => array('image/jpeg', 'image/jpg'), > "max_size" => $configData['max_size'] * 1024 > ), array( > "mime_types" => "Es werden nur Bilder im JPEG-Dateiformat > unterstützt", > "max_size" => "Dein ausgewähltes Bild ist zu groß (maximal ". > $configData['max_size']." Kilobyte)" > ))); > ... > } > > } > > Here is my action: > ... > $this->form->bind($request->getParameter($this->form->getName()), > $request->getFiles($this->form->getName())); > ... > if(!$this->form['step2']['image']->hasError() && is_object($this->form > ['step2']['image']->getValue())) > { > # upload > > } > > $this->form['step2']['image']->getValue() is always NULL. Furthermore > $request->getFiles($this->form->getName()) is empty. How can that be?? > The $_FILES array is not empty, so the files has been correctly sent > to the server. > > I could really need some help here! Thanks, > > Julian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---