I've not commited the code where I try to use the attribute because it
doesn't really make any difference.
Here is what I did: first I added enctype attribute to form in Project/
create.html.php and added the FileField element to Application
\PortfolioBundle\Form\Project in the configure() method:
$this->add(new FileField('image', array(
'secret' => md5('blablabla'))));
After that I added files data to $form->bind() in createAction() on
ProjectController
$form->bind($this->get('request')->request->get($form-
>getName()),
$this->get('request')->files->get($form-
>getName()));
After that I created method setImage($image) in Project entity. But
$image is null... I try debug and think thas problem in files params
to bind.
Just one simple question with no connetion to my specific problem: can
anyone confirm this functionality is actually working or were there
any problems? Thanks!
On 2 Лют, 20:37, Gábor Fási <[email protected]> wrote:
> Your form is missing the enctype attribute.
>
>
>
>
>
>
>
> On Wed, Feb 2, 2011 at 16:04, stfalcon <[email protected]> wrote:
> > In my symfony2 sample projecthttps://github.com/stfalcon/portfolioI
> > need upload screenshots to projects.
> > I try use FileField and debug him. But can't get it to work...
>
> > I found no examples or docs of its use. Somebody used FileField in
> > form to file upload? It's working?
>
> > --
> > If you want to report a vulnerability issue on symfony, please send it to
> > security at symfony-project.com
>
> > You received this message because you are subscribed to the Google
> > Groups "symfony users" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> >http://groups.google.com/group/symfony-users?hl=en
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en