<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Symfony 1.2: upload a file inside an embedded form</title>
	<atom:link href="http://stereointeractive.com/blog/2008/12/23/symfony-12-upload-a-file-inside-an-embedded-form/feed/" rel="self" type="application/rss+xml" />
	<link>http://stereointeractive.com/blog/2008/12/23/symfony-12-upload-a-file-inside-an-embedded-form/</link>
	<description>Development Blog</description>
	<lastBuildDate>Thu, 17 Jun 2010 09:37:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Robert&#39;s Blog &#187; Blog Archive &#187; Internationalized (i18n) Admin Generator CRUD&#8217;s in Symfony 1.2.9 + Doctrine</title>
		<link>http://stereointeractive.com/blog/2008/12/23/symfony-12-upload-a-file-inside-an-embedded-form/comment-page-1/#comment-552</link>
		<dc:creator>Robert&#39;s Blog &#187; Blog Archive &#187; Internationalized (i18n) Admin Generator CRUD&#8217;s in Symfony 1.2.9 + Doctrine</dc:creator>
		<pubDate>Thu, 18 Mar 2010 22:32:29 +0000</pubDate>
		<guid isPermaLink="false">http://stereointeractive.com/blog/?p=129#comment-552</guid>
		<description>[...] edit 10/04/09 10:42PM -&gt; Stereo Interactive has a work around for this [...]</description>
		<content:encoded><![CDATA[<p>[...] edit 10/04/09 10:42PM -&gt; Stereo Interactive has a work around for this [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pedro</title>
		<link>http://stereointeractive.com/blog/2008/12/23/symfony-12-upload-a-file-inside-an-embedded-form/comment-page-1/#comment-512</link>
		<dc:creator>Pedro</dc:creator>
		<pubDate>Mon, 07 Dec 2009 00:15:14 +0000</pubDate>
		<guid isPermaLink="false">http://stereointeractive.com/blog/?p=129#comment-512</guid>
		<description>Hi, I&#039;ve tryed this and it works fine, when the file field has value. But when I&#039;m editing back the record and don&#039;t change the file. The file gets deleted. Anyone of you had the same problem?

Tia</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;ve tryed this and it works fine, when the file field has value. But when I&#8217;m editing back the record and don&#8217;t change the file. The file gets deleted. Anyone of you had the same problem?</p>
<p>Tia</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vancouver Marinas</title>
		<link>http://stereointeractive.com/blog/2008/12/23/symfony-12-upload-a-file-inside-an-embedded-form/comment-page-1/#comment-510</link>
		<dc:creator>Vancouver Marinas</dc:creator>
		<pubDate>Wed, 18 Nov 2009 03:18:26 +0000</pubDate>
		<guid isPermaLink="false">http://stereointeractive.com/blog/?p=129#comment-510</guid>
		<description>great tips thanks alot</description>
		<content:encoded><![CDATA[<p>great tips thanks alot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rv park</title>
		<link>http://stereointeractive.com/blog/2008/12/23/symfony-12-upload-a-file-inside-an-embedded-form/comment-page-1/#comment-508</link>
		<dc:creator>rv park</dc:creator>
		<pubDate>Sat, 14 Nov 2009 03:39:00 +0000</pubDate>
		<guid isPermaLink="false">http://stereointeractive.com/blog/?p=129#comment-508</guid>
		<description>thank you for sharing this embed code.

and great usefull help in the comments :D</description>
		<content:encoded><![CDATA[<p>thank you for sharing this embed code.</p>
<p>and great usefull help in the comments <img src='http://stereointeractive.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dwitv</title>
		<link>http://stereointeractive.com/blog/2008/12/23/symfony-12-upload-a-file-inside-an-embedded-form/comment-page-1/#comment-507</link>
		<dc:creator>dwitv</dc:creator>
		<pubDate>Fri, 13 Nov 2009 10:13:32 +0000</pubDate>
		<guid isPermaLink="false">http://stereointeractive.com/blog/?p=129#comment-507</guid>
		<description>awsome great work :D
this will be handy and I know someone that can use it aswell. Thank you</description>
		<content:encoded><![CDATA[<p>awsome great work <img src='http://stereointeractive.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
this will be handy and I know someone that can use it aswell. Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Kary</title>
		<link>http://stereointeractive.com/blog/2008/12/23/symfony-12-upload-a-file-inside-an-embedded-form/comment-page-1/#comment-500</link>
		<dc:creator>John Kary</dc:creator>
		<pubDate>Sun, 01 Nov 2009 23:31:27 +0000</pubDate>
		<guid isPermaLink="false">http://stereointeractive.com/blog/?p=129#comment-500</guid>
		<description>Thank you thank you thank you for the new $form-&gt;bind() override!! My form was functioning properly when submitting by itself when not embedded, but when it was embedded in another form, I could not access $this-&gt;getValue(&#039;myfield&#039;) in the embedded form class. Your method of iterating through each embedded form and manually-binding the submitted values fixed everything!</description>
		<content:encoded><![CDATA[<p>Thank you thank you thank you for the new $form-&gt;bind() override!! My form was functioning properly when submitting by itself when not embedded, but when it was embedded in another form, I could not access $this-&gt;getValue(&#8216;myfield&#8217;) in the embedded form class. Your method of iterating through each embedded form and manually-binding the submitted values fixed everything!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raul Ramos</title>
		<link>http://stereointeractive.com/blog/2008/12/23/symfony-12-upload-a-file-inside-an-embedded-form/comment-page-1/#comment-497</link>
		<dc:creator>Raul Ramos</dc:creator>
		<pubDate>Wed, 14 Oct 2009 14:35:38 +0000</pubDate>
		<guid isPermaLink="false">http://stereointeractive.com/blog/?p=129#comment-497</guid>
		<description>When embedding a file form into another form, I got &quot;Unexpected extra form field named...&quot; with the name of my embedded form. Any ideas?</description>
		<content:encoded><![CDATA[<p>When embedding a file form into another form, I got &#8220;Unexpected extra form field named&#8230;&#8221; with the name of my embedded form. Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leonardo lazzaro</title>
		<link>http://stereointeractive.com/blog/2008/12/23/symfony-12-upload-a-file-inside-an-embedded-form/comment-page-1/#comment-429</link>
		<dc:creator>leonardo lazzaro</dc:creator>
		<pubDate>Sat, 13 Jun 2009 18:17:00 +0000</pubDate>
		<guid isPermaLink="false">http://stereointeractive.com/blog/?p=129#comment-429</guid>
		<description>Great!
thanks a lot, I couldn&#039;t fix this problem</description>
		<content:encoded><![CDATA[<p>Great!<br />
thanks a lot, I couldn&#8217;t fix this problem</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nerVo</title>
		<link>http://stereointeractive.com/blog/2008/12/23/symfony-12-upload-a-file-inside-an-embedded-form/comment-page-1/#comment-415</link>
		<dc:creator>nerVo</dc:creator>
		<pubDate>Thu, 30 Apr 2009 09:51:38 +0000</pubDate>
		<guid isPermaLink="false">http://stereointeractive.com/blog/?p=129#comment-415</guid>
		<description>I had the same problem, and found that there may be a bug in the function processUploadedFile().

At the end, it calls : return $this-&gt;saveFile($field, $filename);

If you&#039;re looking in saveFile() params, you see there are 3 : $field, $filename and $file. If $file is null, the method take it from $this-&gt;values : 

if (is_null($file))
{
 $file = $this-&gt;getValue($field);
}

As you say, the problem came here, as the form object still does not have values.
But wait, the method processUploadedFile() which calls saveFile() HAS the value itself.

So, if you replace :

return $this-&gt;saveFile($field, $filename);

bye : 

return $this-&gt;saveFile($field, $filename, $values[$field]);

Tadaaaam ! It works !</description>
		<content:encoded><![CDATA[<p>I had the same problem, and found that there may be a bug in the function processUploadedFile().</p>
<p>At the end, it calls : return $this-&gt;saveFile($field, $filename);</p>
<p>If you&#8217;re looking in saveFile() params, you see there are 3 : $field, $filename and $file. If $file is null, the method take it from $this-&gt;values : </p>
<p>if (is_null($file))<br />
{<br />
 $file = $this-&gt;getValue($field);<br />
}</p>
<p>As you say, the problem came here, as the form object still does not have values.<br />
But wait, the method processUploadedFile() which calls saveFile() HAS the value itself.</p>
<p>So, if you replace :</p>
<p>return $this-&gt;saveFile($field, $filename);</p>
<p>bye : </p>
<p>return $this-&gt;saveFile($field, $filename, $values[$field]);</p>
<p>Tadaaaam ! It works !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukis</title>
		<link>http://stereointeractive.com/blog/2008/12/23/symfony-12-upload-a-file-inside-an-embedded-form/comment-page-1/#comment-414</link>
		<dc:creator>Lukis</dc:creator>
		<pubDate>Tue, 28 Apr 2009 18:18:23 +0000</pubDate>
		<guid isPermaLink="false">http://stereointeractive.com/blog/?p=129#comment-414</guid>
		<description>Hi

This one works for me also but i dont want random filename, i would like to have filename coresponding with picture ID in my database.

previously I used this method to get such result:

class Picture extends BasePicture
{
  public function generateUrlFilename(sfValidatedFile $file)
  {
    return $this-&gt;getId().$file-&gt;getExtension($file-&gt;getOriginalExtension());
  }
}

It dont work with this tutorial couse while file is saved to disk its not yet saved in database.

Anyone can help me fix my problem?</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>This one works for me also but i dont want random filename, i would like to have filename coresponding with picture ID in my database.</p>
<p>previously I used this method to get such result:</p>
<p>class Picture extends BasePicture<br />
{<br />
  public function generateUrlFilename(sfValidatedFile $file)<br />
  {<br />
    return $this-&gt;getId().$file-&gt;getExtension($file-&gt;getOriginalExtension());<br />
  }<br />
}</p>
<p>It dont work with this tutorial couse while file is saved to disk its not yet saved in database.</p>
<p>Anyone can help me fix my problem?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
