<?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: Be careful with file uploads</title>
	<atom:link href="http://cakebaker.42dh.com/2006/07/25/be-careful-with-file-uploads/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2006/07/25/be-careful-with-file-uploads/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:12:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2006/07/25/be-careful-with-file-uploads/comment-page-1/#comment-167498</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Fri, 09 Jul 2010 14:26:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=232#comment-167498</guid>
		<description>@fairuz: You can access the file data in your controller in the following way:
&lt;code&gt;
$this-&gt;data[&#039;Post&#039;][&#039;file1&#039;][&#039;name&#039;];
$this-&gt;data[&#039;Post&#039;][&#039;file2&#039;][&#039;name&#039;];
&lt;/code&gt;
However, a more flexible solution is to modify your view slightly:
&lt;code&gt;
...
$this-&gt;Form-&gt;file(&#039;Post.0.File&#039;);
$this-&gt;Form-&gt;file(&#039;Post.1.File&#039;);
...
&lt;/code&gt;
You can then access the data like:
&lt;code&gt;
$this-&gt;data[&#039;Post&#039;][0][&#039;File&#039;][&#039;name&#039;];
$this-&gt;data[&#039;Post&#039;][1][&#039;File&#039;][&#039;name&#039;];
&lt;/code&gt;
This approach makes it easier to loop over the files.

I hope this answers your question.</description>
		<content:encoded><![CDATA[<p>@fairuz: You can access the file data in your controller in the following way:<br />
<pre><code>$this-&gt;data['Post']['file1']['name'];
$this-&gt;data['Post']['file2']['name'];</code></pre><br />
However, a more flexible solution is to modify your view slightly:<br />
<pre><code>...
$this-&gt;Form-&gt;file('Post.0.File');
$this-&gt;Form-&gt;file('Post.1.File');
...</code></pre><br />
You can then access the data like:<br />
<pre><code>$this-&gt;data['Post'][0]['File']['name'];
$this-&gt;data['Post'][1]['File']['name'];</code></pre><br />
This approach makes it easier to loop over the files.</p>
<p>I hope this answers your question.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fairuz</title>
		<link>http://cakebaker.42dh.com/2006/07/25/be-careful-with-file-uploads/comment-page-1/#comment-167424</link>
		<dc:creator>fairuz</dc:creator>
		<pubDate>Thu, 08 Jul 2010 13:22:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=232#comment-167424</guid>
		<description>how to make multi file upload. see my code below 
&lt;code&gt;
&lt;?php
// my view ... add.ctp
$this-&gt;Form-&gt;create(&#039;Post&#039;,array(&#039;action&#039;=&gt;&#039;add&#039;,&#039;type&#039;=&gt;&#039;file&#039;));
$this-&gt;Form-&gt;file(&#039;file1&#039;);
$this-&gt;Form-&gt;file(&#039;file2&#039;);
$this-&gt;Form-&gt;submit(&#039;Upload &#039;);
$this-&gt;Form-&gt;end();
?&gt;
&lt;/code&gt;

how to create controller  for multiple files?</description>
		<content:encoded><![CDATA[<p>how to make multi file upload. see my code below<br />
<pre><code>&lt;?php
// my view ... add.ctp
$this-&gt;Form-&gt;create('Post',array('action'=&gt;'add','type'=&gt;'file'));
$this-&gt;Form-&gt;file('file1');
$this-&gt;Form-&gt;file('file2');
$this-&gt;Form-&gt;submit('Upload ');
$this-&gt;Form-&gt;end();
?&gt;</code></pre>
<p>how to create controller  for multiple files?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2006/07/25/be-careful-with-file-uploads/comment-page-1/#comment-111006</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Wed, 22 Oct 2008 14:22:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=232#comment-111006</guid>
		<description>@Joker-eph: Thanks for the hint, it is now fixed in the article!</description>
		<content:encoded><![CDATA[<p>@Joker-eph: Thanks for the hint, it is now fixed in the article!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joker-eph</title>
		<link>http://cakebaker.42dh.com/2006/07/25/be-careful-with-file-uploads/comment-page-1/#comment-110715</link>
		<dc:creator>Joker-eph</dc:creator>
		<pubDate>Mon, 20 Oct 2008 12:10:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=232#comment-110715</guid>
		<description>Seems to be just a bad hack... The security hole still remains :

&lt;code&gt;
    &lt;input type=&quot;hidden&quot; name=&quot;File[tmp_name]&quot;
                 value=&quot;/tmp/../home/dho/projectA/app/config/database.php&quot; /&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Seems to be just a bad hack&#8230; The security hole still remains :</p>
<pre><code>&lt;input type="hidden" name="File[tmp_name]"
                 value="/tmp/../home/dho/projectA/app/config/database.php" /&gt;</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker &#187; File upload with CakePHP</title>
		<link>http://cakebaker.42dh.com/2006/07/25/be-careful-with-file-uploads/comment-page-1/#comment-2213</link>
		<dc:creator>cakebaker &#187; File upload with CakePHP</dc:creator>
		<pubDate>Mon, 25 Dec 2006 07:08:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=232#comment-2213</guid>
		<description>[...] Update (2006-08-05): Fixed a security hole in the code above, see also &#8220;Be careful with file uploads&#8221;. Thanks to Lamby. [...]</description>
		<content:encoded><![CDATA[<p>[...] Update (2006-08-05): Fixed a security hole in the code above, see also &#8220;Be careful with file uploads&#8221;. Thanks to Lamby. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lamby</title>
		<link>http://cakebaker.42dh.com/2006/07/25/be-careful-with-file-uploads/comment-page-1/#comment-635</link>
		<dc:creator>Lamby</dc:creator>
		<pubDate>Tue, 05 Sep 2006 01:57:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=232#comment-635</guid>
		<description>:-)</description>
		<content:encoded><![CDATA[<p>:-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2006/07/25/be-careful-with-file-uploads/comment-page-1/#comment-633</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Sat, 05 Aug 2006 13:06:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=232#comment-633</guid>
		<description>Yes, it is possible to use is_uploaded_file.</description>
		<content:encoded><![CDATA[<p>Yes, it is possible to use is_uploaded_file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madarco</title>
		<link>http://cakebaker.42dh.com/2006/07/25/be-careful-with-file-uploads/comment-page-1/#comment-634</link>
		<dc:creator>Madarco</dc:creator>
		<pubDate>Sun, 30 Jul 2006 16:19:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=232#comment-634</guid>
		<description>Hi, isn&#039;t possible to use is_uploaded_file on params[&#039;form&#039;][&#039;File&#039;][&#039;tmp_name&#039;]?</description>
		<content:encoded><![CDATA[<p>Hi, isn&#8217;t possible to use is_uploaded_file on params['form']['File']['tmp_name']?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

