<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Incero &#187; file</title>
	<atom:link href="http://www.incero.com/tag/file/feed" rel="self" type="application/rss+xml" />
	<link>http://www.incero.com</link>
	<description>Technology done right</description>
	<lastBuildDate>Sun, 29 Aug 2010 07:52:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Securing Joomla Media Files With Login Sessions</title>
		<link>http://www.incero.com/webdev/securing-joomla-media-files-with-login-sessions</link>
		<comments>http://www.incero.com/webdev/securing-joomla-media-files-with-login-sessions#comments</comments>
		<pubDate>Tue, 11 May 2010 21:08:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[leech]]></category>
		<category><![CDATA[protection]]></category>

		<guid isPermaLink="false">http://www.incero.com/?p=402</guid>
		<description><![CDATA[We recently completed an excellent Joomla file protection script which allows Joomla CMS webmasters to secure their digital files based on the current user login session preventing leeching. Using our Joomla file protection script you can simply drop our securefile.php in any folder that contains files that you want to protect and they will only [...]]]></description>
			<content:encoded><![CDATA[<p>We recently completed an excellent Joomla file protection script which allows Joomla CMS webmasters to secure their digital files based on the current user login session preventing leeching.</p>
<p>Using our Joomla file protection script you can simply drop our securefile.php in any folder that contains files that you want to protect and they will only be loadable by registered and logged in users.</p>
<p>Here&#8217;s how it works:</p>
<ol>
<li>All file requests for media files including videos and images are automatically passed to securefile.php</li>
<li>securefile.php checks that the user is already logged by checking the Joomla session and cookie data</li>
<li>displays the requested file, or shows an error message if permission is denied.</li>
</ol>
<p>An example usage would be that you have a several .swf presentations  that you want to show to your registered users only, they view your  webpage source code and then steal the link to the .swf (such as  http://www.mywebsite.com/files/presentation4.swf). The user then shares  that direct link to your presentation with non registered users  resulting in bandwidth usage and lost revenue. With the leech protection system those direct links will not work for non registered users.</p>
<p>This beauty of this system is that you can keep using your existing video players and presentations on your site as you always have without having to modify your code. We can set this up for you from just $60, <a href="/contact-us" target="_self">contact us</a> for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.incero.com/webdev/securing-joomla-media-files-with-login-sessions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking Remote File Size With PHP</title>
		<link>http://www.incero.com/webdev/checking-remote-file-size-with-php</link>
		<comments>http://www.incero.com/webdev/checking-remote-file-size-with-php#comments</comments>
		<pubDate>Thu, 15 Oct 2009 18:13:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[size]]></category>

		<guid isPermaLink="false">http://www.incero.com/?p=239</guid>
		<description><![CDATA[If you&#8217;re going to grab a file from a remote server using PHP it may be useful to know how large the file is before grabbing it. We can check the remote file headers for the file size by using CURL like so: function remote_filesize($url, $user = &#8220;&#8221;, $pw = &#8220;&#8221;) { ob_start(); $ch = [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re going to grab a file from a remote server using PHP it may be useful to know how large the file is before grabbing it. We can check the remote file headers for the file size by using CURL like so:</p>
<blockquote><p>function remote_filesize($url, $user = &#8220;&#8221;, $pw = &#8220;&#8221;) {<br />
ob_start();<br />
$ch = curl_init($url);<br />
curl_setopt($ch, CURLOPT_HEADER, 1);<br />
curl_setopt($ch, CURLOPT_NOBODY, 1);</p>
<p>if(!empty($user) &amp;&amp; !empty($pw))<br />
{<br />
$headers = array(&#8216;Authorization: Basic &#8216; . base64_encode(&#8220;$user:$pw&#8221;));<br />
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);<br />
}</p>
<p>$ok = curl_exec($ch);<br />
curl_close($ch);<br />
$head = ob_get_contents();<br />
ob_end_clean();</p>
<p>$regex = &#8216;/Content-Length:s([0-9].+?)s/&#8217;;<br />
$count = preg_match($regex, $head, $matches);</p>
<p>return isset($matches[1]) ? $matches[1] : &#8220;unknown&#8221;;<br />
}</p></blockquote>
<p>To use the function we could do something like this:</p>
<blockquote><p>$file=&#8221;http://img1.putpic.com/images/main/10/28719152288-orig.jpg&#8221;;<br />
echo remote_filesize($file);</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.incero.com/webdev/checking-remote-file-size-with-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
