<?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: Implementing Secure File Upload in PHP</title>
	<atom:link href="http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/</link>
	<description>Daily Blog from Internet Entrepreneur/Webmaster</description>
	<lastBuildDate>Sat, 20 Mar 2010 11:13:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: DJ</title>
		<link>http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-7059</link>
		<dc:creator>DJ</dc:creator>
		<pubDate>Tue, 23 Feb 2010 03:42:46 +0000</pubDate>
		<guid isPermaLink="false">http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-7059</guid>
		<description>Thanks govna&#039; that hit the spot</description>
		<content:encoded><![CDATA[<p>Thanks govna&#8217; that hit the spot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hitesh</title>
		<link>http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-4953</link>
		<dc:creator>Hitesh</dc:creator>
		<pubDate>Sun, 15 Nov 2009 11:47:50 +0000</pubDate>
		<guid isPermaLink="false">http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-4953</guid>
		<description>Nice information.. really helpful. 
Well this can help you in secure file writing through ftp in php
http://phpwala.wordpress.com/2009/11/15/how-to-write-file-though-ftp-in-php-without-777-permission/</description>
		<content:encoded><![CDATA[<p>Nice information.. really helpful.<br />
Well this can help you in secure file writing through ftp in php<br />
<a href="http://phpwala.wordpress.com/2009/11/15/how-to-write-file-though-ftp-in-php-without-777-permission/" rel="nofollow">http://phpwala.wordpress.com/2009/11/15/how-to-write-file-though-ftp-in-php-without-777-permission/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Su</title>
		<link>http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-3398</link>
		<dc:creator>Su</dc:creator>
		<pubDate>Thu, 16 Apr 2009 10:49:45 +0000</pubDate>
		<guid isPermaLink="false">http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-3398</guid>
		<description>Thanks it was really a wonderful suggestion!</description>
		<content:encoded><![CDATA[<p>Thanks it was really a wonderful suggestion!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrik</title>
		<link>http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-3383</link>
		<dc:creator>Patrik</dc:creator>
		<pubDate>Fri, 10 Apr 2009 06:51:10 +0000</pubDate>
		<guid isPermaLink="false">http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-3383</guid>
		<description>Thanks mate,this was exactly what I was looking for.</description>
		<content:encoded><![CDATA[<p>Thanks mate,this was exactly what I was looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaushik</title>
		<link>http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-2997</link>
		<dc:creator>Kaushik</dc:creator>
		<pubDate>Tue, 03 Mar 2009 05:59:16 +0000</pubDate>
		<guid isPermaLink="false">http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-2997</guid>
		<description>Hi there,
awesome tips. Another layman query though, this is actually more wordpress specific, I use a shared host and have to necessarily give the 777 permission on uploads. the issue though is more of the ownership. I understand it is possible to do the chmod and chown commands through php itself, any light on this? the main issue for me is that my shared host assigns the username as user and group id, but when wordpress connects to the file it uses nobody i.e 99/99 . Any thoughts on if/how this can be controlled? Thanks in advance</description>
		<content:encoded><![CDATA[<p>Hi there,<br />
awesome tips. Another layman query though, this is actually more wordpress specific, I use a shared host and have to necessarily give the 777 permission on uploads. the issue though is more of the ownership. I understand it is possible to do the chmod and chown commands through php itself, any light on this? the main issue for me is that my shared host assigns the username as user and group id, but when wordpress connects to the file it uses nobody i.e 99/99 . Any thoughts on if/how this can be controlled? Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JR</title>
		<link>http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-2962</link>
		<dc:creator>JR</dc:creator>
		<pubDate>Sun, 01 Mar 2009 10:37:10 +0000</pubDate>
		<guid isPermaLink="false">http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-2962</guid>
		<description>Great script Thanks !!</description>
		<content:encoded><![CDATA[<p>Great script Thanks !!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carol</title>
		<link>http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-2509</link>
		<dc:creator>Carol</dc:creator>
		<pubDate>Mon, 22 Dec 2008 21:36:24 +0000</pubDate>
		<guid isPermaLink="false">http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-2509</guid>
		<description>Hi,

I think rather than adding htaccess its better to add the codes in httpd.conf as 


    Options -Indexes
    Options -ExecCGI
    AddHandler cgi-script .php .php3 .php4 .phtml .pl .py .jsp .asp .htm .shtml .sh .cgi


bcoz .htaccess has some performance issues.

thanks
Carol</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I think rather than adding htaccess its better to add the codes in httpd.conf as </p>
<p>    Options -Indexes<br />
    Options -ExecCGI<br />
    AddHandler cgi-script .php .php3 .php4 .phtml .pl .py .jsp .asp .htm .shtml .sh .cgi</p>
<p>bcoz .htaccess has some performance issues.</p>
<p>thanks<br />
Carol</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pbu</title>
		<link>http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-2137</link>
		<dc:creator>pbu</dc:creator>
		<pubDate>Thu, 13 Nov 2008 21:40:39 +0000</pubDate>
		<guid isPermaLink="false">http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-2137</guid>
		<description>In that case the only option you have is to make folder writable 777. however you can also hide the contents of folder and disable exec permissions with htaccess file</description>
		<content:encoded><![CDATA[<p>In that case the only option you have is to make folder writable 777. however you can also hide the contents of folder and disable exec permissions with htaccess file</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephen chan</title>
		<link>http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-2135</link>
		<dc:creator>stephen chan</dc:creator>
		<pubDate>Thu, 13 Nov 2008 13:27:31 +0000</pubDate>
		<guid isPermaLink="false">http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-2135</guid>
		<description>Hi!
If a website is shared-hosted and have no control over Apache setting, and there are no specific file type that is allowed or not allowed, what can I do?

By the way, is there anyway where I can build in a virus checking (triggering some anti-virus software to check the file to be uploaded) mechanism.

Thanks,
Stephen</description>
		<content:encoded><![CDATA[<p>Hi!<br />
If a website is shared-hosted and have no control over Apache setting, and there are no specific file type that is allowed or not allowed, what can I do?</p>
<p>By the way, is there anyway where I can build in a virus checking (triggering some anti-virus software to check the file to be uploaded) mechanism.</p>
<p>Thanks,<br />
Stephen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DrTebi</title>
		<link>http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-795</link>
		<dc:creator>DrTebi</dc:creator>
		<pubDate>Sun, 24 Aug 2008 11:25:12 +0000</pubDate>
		<guid isPermaLink="false">http://corpocrat.com/2007/11/28/implementing-secure-file-upload-in-php/#comment-795</guid>
		<description>Yes, disallowing directory browsing should be enforced as well. I actually have it disabled system-wide, and enable it if I see a need for it.

I have found an interesting and quite comprehensive document that explains all the problems with image uploads, if you&#039;re interested, you can find it here:
http://www.scanit.be/uploads/php-file-upload.pdf

Still... my suggestion works very well. But after reading this document, I figured that image uploads can still cause problems, if they have some hidden PHP code in it. But there is yet another simple solution: just turn off the PHP engine for the image directory. This can be done within a directory container block in httpd.conf:

php_admin_value engine Off

or in an .htaccess file within the image directory:

php_value engine Off


Have a nice day :) DrTebi</description>
		<content:encoded><![CDATA[<p>Yes, disallowing directory browsing should be enforced as well. I actually have it disabled system-wide, and enable it if I see a need for it.</p>
<p>I have found an interesting and quite comprehensive document that explains all the problems with image uploads, if you&#8217;re interested, you can find it here:<br />
<a href="http://www.scanit.be/uploads/php-file-upload.pdf" rel="nofollow">http://www.scanit.be/uploads/php-file-upload.pdf</a></p>
<p>Still&#8230; my suggestion works very well. But after reading this document, I figured that image uploads can still cause problems, if they have some hidden PHP code in it. But there is yet another simple solution: just turn off the PHP engine for the image directory. This can be done within a directory container block in httpd.conf:</p>
<p>php_admin_value engine Off</p>
<p>or in an .htaccess file within the image directory:</p>
<p>php_value engine Off</p>
<p>Have a nice day <img src='http://corpocrat.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  DrTebi</p>
]]></content:encoded>
	</item>
</channel>
</rss>
