<?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>itlivewire dev blog &#187; codeigniter</title>
	<atom:link href="http://itlivewire.com/devblog/category/codeigniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://itlivewire.com/devblog</link>
	<description>Just another web development blog...</description>
	<lastBuildDate>Tue, 07 Sep 2010 16:20:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>codeigniter upload &#8220;The filetype you are attempting to upload is not allowed&#8221;</title>
		<link>http://itlivewire.com/devblog/2010/04/13/codeigniter-upload-the-filetype-you-are-attempting-to-upload-is-not-allowed/</link>
		<comments>http://itlivewire.com/devblog/2010/04/13/codeigniter-upload-the-filetype-you-are-attempting-to-upload-is-not-allowed/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 02:36:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://itlivewire.com/devblog/?p=353</guid>
		<description><![CDATA[Error when uploading your file using codeigniter upload
&#8220;The filetype you are attempting to upload is not allowed&#8221;
Causes:
1. Invalid file type uploaded by the user your uploading (.doc when only .xls is allowed)
2. The file uploaded is not within the specified file types added in the upload config
3. Mime type error in codeigniter caused by the [...]]]></description>
			<content:encoded><![CDATA[<p>Error when uploading your file using codeigniter upload<br />
<strong>&#8220;The filetype you are attempting to upload is not allowed&#8221;</strong></p>
<p>Causes:</p>
<p>1. Invalid file type uploaded by the user your uploading (.doc when only .xls is allowed)<br />
2. The file uploaded is not within the specified file types added in the upload config<br />
3. Mime type error in codeigniter caused by the mime type of the extension does not match the mime type specified in <strong>/application/config/mimes.php</strong></p>
<p>Start by checking what is the mime type of the file your uploading </p>
<pre class="brush: php;">
$data = array('upload_data' =&gt; $this-&gt;upload-&gt;data());
$mimetype= $data['upload_data']['file_type'];
echo $mimetype;
</pre>
<p>then check in the mimes.php if that mime type matches the extension you want to upload</p>
<p>Example:<br />
word document</p>
<pre class="brush: php;">'doc'	=&gt;	'application/msword'</pre>
<p>excel file has many mime types, if its missing just add it in the array</p>
<pre class="brush: php;">'xls'	=&gt;	array('application/excel', 'application/vnd.ms-excel','application/x-msexcel')</pre>
]]></content:encoded>
			<wfw:commentRss>http://itlivewire.com/devblog/2010/04/13/codeigniter-upload-the-filetype-you-are-attempting-to-upload-is-not-allowed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>codeigniter read or write a file</title>
		<link>http://itlivewire.com/devblog/2009/11/02/codeigniter-read-or-write-a-file/</link>
		<comments>http://itlivewire.com/devblog/2009/11/02/codeigniter-read-or-write-a-file/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 08:16:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://itlivewire.com/devblog/?p=163</guid>
		<description><![CDATA[
In dealing with files on ci use the file helper
http://codeigniter.com/user_guide/helpers/file_helper.html
It is loaded using this line
$this->load->helper(&#8216;file&#8217;);

read a file with read_file()
$data = read_file(&#8216;./path/to/file.php&#8217;);
write a file with write_file();
write_file(&#8216;./path/to/file.php&#8217;, $data, &#8216;w+&#8217;);
CI recommends &#8220;r+&#8221; but its better to use &#8220;w+&#8221;
]]></description>
			<content:encoded><![CDATA[<p><img src="http://codeigniter.com/images/design/ci_logo2.gif" alt="" /></p>
<p>In dealing with files on ci use the <strong>file helper</strong><br />
<a href="http://codeigniter.com/user_guide/helpers/file_helper.html">http://codeigniter.com/user_guide/helpers/file_helper.html</a></p>
<p>It is loaded using this line<br />
$this->load->helper(&#8216;file&#8217;);<br />
<strong><br />
read a file with read_file()</strong><br />
$data = read_file(&#8216;./path/to/file.php&#8217;);</p>
<p><strong>write a file with write_file();</strong><br />
write_file(&#8216;./path/to/file.php&#8217;, $data, &#8216;w+&#8217;);</p>
<p>CI recommends &#8220;r+&#8221; but its better to use &#8220;w+&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://itlivewire.com/devblog/2009/11/02/codeigniter-read-or-write-a-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
