<?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: File uploads with Zend_Form_Element_File</title>
	<atom:link href="http://akrabat.com/php/file-uploads-with-zend_form_element_file/feed/" rel="self" type="application/rss+xml" />
	<link>http://akrabat.com/php/file-uploads-with-zend_form_element_file/</link>
	<description>Developing PHP software in the Real World, by Rob Allen</description>
	<lastBuildDate>Mon, 15 Mar 2010 11:38:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Flavio</title>
		<link>http://akrabat.com/php/file-uploads-with-zend_form_element_file/#comment-31752</link>
		<dc:creator>Flavio</dc:creator>
		<pubDate>Tue, 09 Mar 2010 18:49:02 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=318#comment-31752</guid>
		<description>I used Zend_Form_Element_File to upload a file to webserver through a Zend_form class. How could I use the same class to download the file uploaded previously? I would appreciate any help.
Thank you,
Flávio.</description>
		<content:encoded><![CDATA[<p>I used Zend_Form_Element_File to upload a file to webserver through a Zend_form class. How could I use the same class to download the file uploaded previously? I would appreciate any help.<br />
Thank you,<br />
Flávio.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach</title>
		<link>http://akrabat.com/php/file-uploads-with-zend_form_element_file/#comment-24136</link>
		<dc:creator>Zach</dc:creator>
		<pubDate>Mon, 16 Feb 2009 16:36:18 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=318#comment-24136</guid>
		<description>Thanks!</description>
		<content:encoded><![CDATA[<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thomas</title>
		<link>http://akrabat.com/php/file-uploads-with-zend_form_element_file/#comment-24134</link>
		<dc:creator>thomas</dc:creator>
		<pubDate>Mon, 16 Feb 2009 16:11:24 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=318#comment-24134</guid>
		<description>Simplified:

if (isUploaded) {
    $adapter-&gt;addFilter(&#039;Rename&#039;, $myownname);
    if (isValid) {
        $adapter-&gt;receive();
    } else {
        print &quot;Oops&quot;;
    }
}

Greetings
Thomas</description>
		<content:encoded><![CDATA[<p>Simplified:</p>
<p>if (isUploaded) {<br />
    $adapter-&gt;addFilter('Rename', $myownname);<br />
    if (isValid) {<br />
        $adapter-&gt;receive();<br />
    } else {<br />
        print "Oops";<br />
    }<br />
}</p>
<p>Greetings<br />
Thomas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach</title>
		<link>http://akrabat.com/php/file-uploads-with-zend_form_element_file/#comment-24133</link>
		<dc:creator>Zach</dc:creator>
		<pubDate>Mon, 16 Feb 2009 15:36:51 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=318#comment-24133</guid>
		<description>Its kind of a chicken and the egg thing, unless I&#039;m missing something though.  I&#039;m really new to Zend Framework so I&#039;d love if you could correct me, but I want to rename the file with a unique id number, but I can only create that unique ID number after the file has uploaded and and the move filter has been triggered?

Or could I set the filter after isuploaded() but before receive()?</description>
		<content:encoded><![CDATA[<p>Its kind of a chicken and the egg thing, unless I'm missing something though.  I'm really new to Zend Framework so I'd love if you could correct me, but I want to rename the file with a unique id number, but I can only create that unique ID number after the file has uploaded and and the move filter has been triggered?</p>
<p>Or could I set the filter after isuploaded() but before receive()?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thomas</title>
		<link>http://akrabat.com/php/file-uploads-with-zend_form_element_file/#comment-24130</link>
		<dc:creator>thomas</dc:creator>
		<pubDate>Mon, 16 Feb 2009 06:55:37 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=318#comment-24130</guid>
		<description>@Zach:
Don&#039;t you think that this is quite unhandy ?

Wouldn&#039;t it be better to use the Rename Filter instead of extending the form element ? ;-)

Greetings
Thomas</description>
		<content:encoded><![CDATA[<p>@Zach:<br />
Don't you think that this is quite unhandy ?</p>
<p>Wouldn't it be better to use the Rename Filter instead of extending the form element ? ;-)</p>
<p>Greetings<br />
Thomas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach</title>
		<link>http://akrabat.com/php/file-uploads-with-zend_form_element_file/#comment-24127</link>
		<dc:creator>Zach</dc:creator>
		<pubDate>Sun, 15 Feb 2009 23:32:36 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=318#comment-24127</guid>
		<description>I&#039;m working on a project using Zend_Form_Element_File myself right now, and I&#039;m interested in how you&#039;d handle a situation where you need to rename the file based on a database quey (lastinsertid.) Its pretty obvious that this element is fairly new, because its really a major security flaw to not have anything in place to easily rename the uploaded file based on critera like a userid or a pictureid.  You can set it to not overwrite an existing file, at least closing the hole of your admin&#039;s profile getting overwritten with goatse, but that also makes it quite hard to upload generic sounding files (how many people might name a file profile.jpg? I&#039;m guessing more than one on the entire internet) or even impossible in a situation where you&#039;re collecting the same exact file from people (&quot;Upload config.ini here please.&quot;)  Right now the only way I can see to do this cleanly would be to massively extend the file element, and have my own functions for recieve etc in my class that take an id or something.  The only other thing I could think of was do an if(isuploaded) and then go in and setdestination() after doing whatever needs to be done to make it a unique filename.</description>
		<content:encoded><![CDATA[<p>I'm working on a project using Zend_Form_Element_File myself right now, and I'm interested in how you'd handle a situation where you need to rename the file based on a database quey (lastinsertid.) Its pretty obvious that this element is fairly new, because its really a major security flaw to not have anything in place to easily rename the uploaded file based on critera like a userid or a pictureid.  You can set it to not overwrite an existing file, at least closing the hole of your admin's profile getting overwritten with goatse, but that also makes it quite hard to upload generic sounding files (how many people might name a file profile.jpg? I'm guessing more than one on the entire internet) or even impossible in a situation where you're collecting the same exact file from people ("Upload config.ini here please.")  Right now the only way I can see to do this cleanly would be to massively extend the file element, and have my own functions for recieve etc in my class that take an id or something.  The only other thing I could think of was do an if(isuploaded) and then go in and setdestination() after doing whatever needs to be done to make it a unique filename.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thomas</title>
		<link>http://akrabat.com/php/file-uploads-with-zend_form_element_file/#comment-23979</link>
		<dc:creator>thomas</dc:creator>
		<pubDate>Sat, 24 Jan 2009 17:32:30 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=318#comment-23979</guid>
		<description>But of course only when they upload the same file within the same millisecond. :-)

And that&#039;s a rare race condition (you would get an error/exception as user in this case)

Greetings
Thomas</description>
		<content:encoded><![CDATA[<p>But of course only when they upload the same file within the same millisecond. :-)</p>
<p>And that's a rare race condition (you would get an error/exception as user in this case)</p>
<p>Greetings<br />
Thomas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob...</title>
		<link>http://akrabat.com/php/file-uploads-with-zend_form_element_file/#comment-23978</link>
		<dc:creator>Rob...</dc:creator>
		<pubDate>Sat, 24 Jan 2009 17:06:21 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=318#comment-23978</guid>
		<description>Sebastian,

Probably :)

Rob...</description>
		<content:encoded><![CDATA[<p>Sebastian,</p>
<p>Probably :)</p>
<p>Rob...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian</title>
		<link>http://akrabat.com/php/file-uploads-with-zend_form_element_file/#comment-23977</link>
		<dc:creator>Sebastian</dc:creator>
		<pubDate>Sat, 24 Jan 2009 16:34:39 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=318#comment-23977</guid>
		<description>Doesn&#039;t this cause race conditions when multiple users concurrently upload a file named a.ext?</description>
		<content:encoded><![CDATA[<p>Doesn't this cause race conditions when multiple users concurrently upload a file named a.ext?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Reynolds</title>
		<link>http://akrabat.com/php/file-uploads-with-zend_form_element_file/#comment-23717</link>
		<dc:creator>Tim Reynolds</dc:creator>
		<pubDate>Mon, 08 Dec 2008 02:41:31 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=318#comment-23717</guid>
		<description>Nice post. Thank you for the info. Keep it up.</description>
		<content:encoded><![CDATA[<p>Nice post. Thank you for the info. Keep it up.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
