<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Blue Ember Design</title>
	
	<link>http://www.blueemberdesign.com</link>
	<description>Web Design, Development, and Online Marketing for the San Francisco &amp; East Bay Area</description>
	<lastBuildDate>Tue, 23 Feb 2010 19:45:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/BlueEmberDesign" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="blueemberdesign" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">BlueEmberDesign</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>FTP Download with the CodeIgniter FTP Library</title>
		<link>http://www.blueemberdesign.com/blog/2010/02/23/ftp-download-codeigniter-library/</link>
		<comments>http://www.blueemberdesign.com/blog/2010/02/23/ftp-download-codeigniter-library/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 16:00:21 +0000</pubDate>
		<dc:creator>Garrett St. John</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[codeigniter ftp]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[ftp library]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.blueemberdesign.com/?p=999</guid>
		<description><![CDATA[I was recently working on a project that involved FTP and I thought it would be a great chance to get away from the built-in PHP functionality and use the CodeIgniter FTP library instead.
I was pretty surprised to find that there was no download functionality in the base FTP library  as of CI 1.7.2.  [...]


Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/08/17/announcing-the-codeigniter-dreamhost-api-library/' rel='bookmark' title='Permanent Link: Announcing the CodeIgniter Dreamhost API Library'>Announcing the CodeIgniter Dreamhost API Library</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/08/25/codeigniter-file-upload-changing-the-file-name/' rel='bookmark' title='Permanent Link: CodeIgniter File Upload: Changing the File Name'>CodeIgniter File Upload: Changing the File Name</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/07/07/formigniter-easy-form-generation-codeigniter/' rel='bookmark' title='Permanent Link: FormIgniter: Easy Form Generation for CodeIgniter'>FormIgniter: Easy Form Generation for CodeIgniter</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was recently working on a project that involved FTP and I thought it would be a great chance to get away from the <a href="http://php.net/manual/en/book.ftp.php">built-in PHP functionality</a> and use the <a href="http://codeigniter.com/user_guide/libraries/ftp.html">CodeIgniter FTP library</a> instead.</p>
<p>I was pretty surprised to find that there was <strong>no download functionality in the base FTP library </strong> as of CI 1.7.2.  I&#8217;ve extended the library to incorporate file download and will share that here.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// This codes goes in the 'application/libraries' folder with a</span>
<span style="color: #666666; font-style: italic;">// file name of MY_Ftp.php</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> MY_Ftp <span style="color: #000000; font-weight: bold;">extends</span> CI_Ftp <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Constructor
	 **/</span>
	<span style="color: #000000; font-weight: bold;">function</span> MY_Ftp<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		parent<span style="color: #339933;">::</span><span style="color: #004000;">CI_Ftp</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Download a file from a FTP server
	 * @param	&lt;string&gt;	$rem_path	Remote path of the file to download
	 * @param	&lt;string&gt;	$loc_path	Local path destination for download
	 * @param	&lt;string&gt;	$mode		Transfer mode, defaults to auto
	 **/</span>
	<span style="color: #000000; font-weight: bold;">function</span> download<span style="color: #009900;">&#40;</span><span style="color: #000088;">$rem_path</span><span style="color: #339933;">,</span> <span style="color: #000088;">$loc_path</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mode</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'auto'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// check for an active connection</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_is_conn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// get remote folder/filename</span>
		<span style="color: #000088;">$rem_folder</span>   <span style="color: #339933;">=</span> <span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$rem_path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$rem_filename</span> <span style="color: #339933;">=</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$rem_path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// if a local directory was passed handle differently.</span>
		<span style="color: #666666; font-style: italic;">// Otherwise, treat same as remote.</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #990000;">is_dir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$loc_path</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$loc_folder</span>   <span style="color: #339933;">=</span> <span style="color: #990000;">rtrim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$loc_path</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$loc_filename</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$rem_filename</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$loc_folder</span>   <span style="color: #339933;">=</span> <span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$loc_path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$loc_filename</span> <span style="color: #339933;">=</span> <span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$loc_path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// check that the loc path exists</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$loc_folder</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'.'</span>  <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span> <span style="color: #339933;">@</span><span style="color: #990000;">is_dir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$loc_folder</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_error<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ftp_bad_loc_path'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #666666; font-style: italic;">// check that loc path and file are writable</span>
		<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #339933;">@</span><span style="color: #990000;">is_writable</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$loc_folder</span><span style="color: #009900;">&#41;</span> OR <span style="color: #009900;">&#40;</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$loc_folder</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$loc_filename</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span> <span style="color: #339933;">@</span><span style="color: #990000;">is_writable</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$loc_folder</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$loc_filename</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_error<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ftp_loc_not_write'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// store old paths</span>
		<span style="color: #000088;">$old_rem_path</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">ftp_pwd</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">conn_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$old_loc_path</span> <span style="color: #339933;">=</span> <span style="color: #990000;">getcwd</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// move to the local path</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #339933;">@</span><span style="color: #990000;">chdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$loc_folder</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_error<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ftp_bad_loc_path'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// move to the remote path</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$rem_folder</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'.'</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">changedir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$rem_folder</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_error<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ftp_bad_rem_path'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// check that the file exists remotely</span>
		<span style="color: #000088;">$found_file</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$files</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">list_files</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$files</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$files</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$f</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$rem_filename</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000088;">$found_file</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">;</span>
					<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #000088;">$found_file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_error<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ftp_bad_rem_file'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Set the mode if not specified</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$mode</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'auto'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// Get the file extension so we can set the upload type</span>
			<span style="color: #000088;">$ext</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_getext<span style="color: #009900;">&#40;</span><span style="color: #000088;">$rem_path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$mode</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_settype<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ext</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000088;">$mode</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$mode</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'ascii'</span><span style="color: #009900;">&#41;</span> ? FTP_ASCII <span style="color: #339933;">:</span> FTP_BINARY<span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// download the file</span>
		<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">ftp_get</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">conn_id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$loc_folder</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$loc_filename</span><span style="color: #339933;">,</span> <span style="color: #000088;">$rem_filename</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mode</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">debug</span> <span style="color: #339933;">==</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span>
				<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_error<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ftp_unable_to_download'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// move back to the root path</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">changedir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$old_rem_path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #339933;">@</span><span style="color: #990000;">chdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$old_loc_path</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>As a side note, you will need to tweak your language file to include all of the message codes (e.g., ftp_bad_loc_path) passed to _error() for proper error display in your app.</p>
<img src="http://www.blueemberdesign.com/?ak_action=api_record_view&id=999&type=feed" alt="" />

<p>Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/08/17/announcing-the-codeigniter-dreamhost-api-library/' rel='bookmark' title='Permanent Link: Announcing the CodeIgniter Dreamhost API Library'>Announcing the CodeIgniter Dreamhost API Library</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/08/25/codeigniter-file-upload-changing-the-file-name/' rel='bookmark' title='Permanent Link: CodeIgniter File Upload: Changing the File Name'>CodeIgniter File Upload: Changing the File Name</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/07/07/formigniter-easy-form-generation-codeigniter/' rel='bookmark' title='Permanent Link: FormIgniter: Easy Form Generation for CodeIgniter'>FormIgniter: Easy Form Generation for CodeIgniter</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.blueemberdesign.com/blog/2010/02/23/ftp-download-codeigniter-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Site Launch: Vital Life Wellness Center</title>
		<link>http://www.blueemberdesign.com/blog/2010/02/18/site-launch-vital-life-wellness-center/</link>
		<comments>http://www.blueemberdesign.com/blog/2010/02/18/site-launch-vital-life-wellness-center/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 00:27:14 +0000</pubDate>
		<dc:creator>Garrett St. John</dc:creator>
				<category><![CDATA[Site Launches]]></category>
		<category><![CDATA[site launch]]></category>
		<category><![CDATA[wordpress template]]></category>

		<guid isPermaLink="false">http://www.blueemberdesign.com/?p=982</guid>
		<description><![CDATA[We are excited to announce a recent website relaunch for one of our clients, Vital Life Wellness Center.
With a desire to join the blogging community and share her passion for healthy living, Blue Ember provided Dr. Andrea Pritchett with a custom Wordpress template.  During the entire design process we paid extra care to matching Vital [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>We are excited to announce a recent website relaunch for one of our clients, <a href="http://www.vlifewellness.com">Vital Life Wellness Center</a>.</p>
<p>With a desire to join the blogging community and share her passion for healthy living, Blue Ember provided Dr. Andrea Pritchett with a custom Wordpress template.  During the entire design process we paid extra care to matching Vital Life&#8217;s existing branding, while lightening it up a bit with a fresh, updated look.</p>
<p>Stop by the new <a href="http://www.vlifewellness.com/health-blog/">blog</a> and join the conversation as Dr. Pritchett helps to &#8220;maximize your life and increase your vitality&#8221;.</p>
<p><strong>BEFORE</strong></p>
<p><img class="alignnone size-full wp-image-986" title="vital-life-wellness-center-old" src="http://www.blueemberdesign.com/wp-content/uploads/2010/02/vital-life-wellness-center-old.jpg" alt="" width="470" height="359" /></p>
<p><strong>AFTER</strong></p>
<p><img class="alignnone size-large wp-image-979" title="vital-life-wellness-center-full" src="http://www.blueemberdesign.com/wp-content/uploads/2009/02/vital-life-wellness-center-full-470x358.jpg" alt="" width="470" height="358" /></p>
<img src="http://www.blueemberdesign.com/?ak_action=api_record_view&id=982&type=feed" alt="" />

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.blueemberdesign.com/blog/2010/02/18/site-launch-vital-life-wellness-center/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tab Key Skipping Drop-downs in Firefox on OSX</title>
		<link>http://www.blueemberdesign.com/blog/2010/02/09/tab-key-skipping-dropdowns-firefox-osx/</link>
		<comments>http://www.blueemberdesign.com/blog/2010/02/09/tab-key-skipping-dropdowns-firefox-osx/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 17:00:05 +0000</pubDate>
		<dc:creator>Garrett St. John</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[drop downs]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[system preferences]]></category>
		<category><![CDATA[tab]]></category>
		<category><![CDATA[tabbing]]></category>
		<category><![CDATA[tabbing form]]></category>

		<guid isPermaLink="false">http://www.blueemberdesign.com/?p=960</guid>
		<description><![CDATA[While tabbing through form fields in Firefox on Mac OSX, drop-downs are skipped and require switching to the mouse to set a value. Read about the fix


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a Mac user for just about a year now (couldn&#8217;t ever go back), but I&#8217;ve noticed an annoying little &#8220;feature&#8221; within Firefox that I was never able to resolve until recently.  While tabbing through form fields, drop-downs are skipped and require switching to the mouse to set a value.</p>
<p>Turns out the issue is pretty simple to resolve.  Go to System Preferences, then select Keyboard.  On the bottom of the window there is a section titled &#8216;Full Keyboard Access&#8217; (as pictured below).</p>
<p><img class="alignnone size-full wp-image-973" title="system-preferences" src="http://www.blueemberdesign.com/wp-content/uploads/2010/02/system-preferences.jpg" alt="" width="470" height="236" /></p>
<p>Simply change the option to &#8216;All controls&#8217; instead of the default.  This will allow you to tab between all elements on the page.  In addition to drop-downs, you will now be able to focus on links as well.</p>
<p><strong>Tip:</strong> The keyboard shortcut Control +F7 will toggle this setting if you prefer to enable/disable it quickly.</p>
<p>A big nod goes to <a href="http://www.howtogeek.com/howto/apple/why-doesnt-tab-work-for-drop-down-controls-in-firefox-on-os-x/">howtogeek.com</a> for this fix.</p>
<img src="http://www.blueemberdesign.com/?ak_action=api_record_view&id=960&type=feed" alt="" />

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.blueemberdesign.com/blog/2010/02/09/tab-key-skipping-dropdowns-firefox-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4 Reasons Open Source Email Marketing Sucks</title>
		<link>http://www.blueemberdesign.com/blog/2009/12/03/4-reasons-open-source-email-marketing-sucks/</link>
		<comments>http://www.blueemberdesign.com/blog/2009/12/03/4-reasons-open-source-email-marketing-sucks/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 17:00:36 +0000</pubDate>
		<dc:creator>Garrett St. John</dc:creator>
				<category><![CDATA[Online Marketing]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[email marketing]]></category>
		<category><![CDATA[mailman]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[phpmailer]]></category>
		<category><![CDATA[pommo]]></category>

		<guid isPermaLink="false">http://www.blueemberdesign.com/?p=932</guid>
		<description><![CDATA[We've tried quite a few open source email marketing solutions from Mailman, to PHPMailer, to poMMo and they all suck for one reason or another.  Here are our reasons why


Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/08/12/pommo-open-source-email-marketing-software/' rel='bookmark' title='Permanent Link: poMMo: Open Source Email Marketing Software'>poMMo: Open Source Email Marketing Software</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/07/13/4-reasons-to-have-a-company-blog/' rel='bookmark' title='Permanent Link: 4 Reasons To Have a Company Blog'>4 Reasons To Have a Company Blog</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve tried quite a few open source email marketing solutions from Mailman, to PHPMailer, to <a href="http://www.blueemberdesign.com/blog/2009/08/12/pommo-open-source-email-marketing-software/">poMMo</a> and they all suck for one reason or another.  Here are our reasons why:</p>
<p><strong>1. They are self hosted solutions</strong><br />
In our experience, self hosting email marketing rarely works out well. Most hosting providers have tight limits on how many emails can be sent per hour from a given domain.  A somewhat average limit of 300 emails/hour implies that it would take 16 hours and 40 minutes to email a list of 5,000 addresses.  While that could be acceptable in certain circumstances, it is less than ideal for a big marketing push or product launch.  Hit 10,000+ addresses and you are talking in days, not hours.  No good for us or our clients!</p>
<p><strong>2. They have clunky and non-intuitive interfaces</strong><br />
We&#8217;re <span style="text-decoration: underline;">BIG</span> supporters of open source software, but have yet to see an open source email marketing tool that has been as slick as the likes of Campaign Monitor or MailChimp.  When passing off open source software to a client, pray they are somewhat technology proficient or you have a support nightmare on your hands.  The best client interface we&#8217;ve seen to date is poMMo, but it still leaves much to be desired.</p>
<p><strong>3. They lack crucial features for professional use</strong><br />
To be usable by a business with any sizable email address list, an email marketing tool has a few &#8220;must-have&#8221; features:</p>
<ul>
<li>Email throttling</li>
<li>Intuitive and simple administration interface</li>
<li>Elegant WYSIWYG email editor (with the ability hand-edit HTML if necessary)</li>
<li>Automated bounce handling</li>
<li>Comprehensive analytical tools to measure campaign success</li>
</ul>
<p><strong>4. There is no strong community</strong><br />
Unlike many other great open source projects, we&#8217;ve found much to be desired in the communities for the top open source email solutions.  This makes support and bug fixes a disaster zone.</p>
<p><strong>You tell us&#8230;</strong><br />
Have you found any great open source email marketing tools that we have missed? Disagree? Let us hear from you&#8230;</p>
<img src="http://www.blueemberdesign.com/?ak_action=api_record_view&id=932&type=feed" alt="" />

<p>Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/08/12/pommo-open-source-email-marketing-software/' rel='bookmark' title='Permanent Link: poMMo: Open Source Email Marketing Software'>poMMo: Open Source Email Marketing Software</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/07/13/4-reasons-to-have-a-company-blog/' rel='bookmark' title='Permanent Link: 4 Reasons To Have a Company Blog'>4 Reasons To Have a Company Blog</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.blueemberdesign.com/blog/2009/12/03/4-reasons-open-source-email-marketing-sucks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PPC or SEO: Which is Best for My Company?</title>
		<link>http://www.blueemberdesign.com/blog/2009/10/30/ppc-seo-best-for-company/</link>
		<comments>http://www.blueemberdesign.com/blog/2009/10/30/ppc-seo-best-for-company/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 16:00:24 +0000</pubDate>
		<dc:creator>Garrett St. John</dc:creator>
				<category><![CDATA[Online Marketing]]></category>
		<category><![CDATA[Pay Per Click Advertising]]></category>
		<category><![CDATA[Search Engine Optimization]]></category>
		<category><![CDATA[advertising]]></category>
		<category><![CDATA[advertising campaign]]></category>
		<category><![CDATA[campaign]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[ppc]]></category>
		<category><![CDATA[ppc advertising]]></category>
		<category><![CDATA[search engine]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[seo campaign]]></category>
		<category><![CDATA[traffic]]></category>

		<guid isPermaLink="false">http://www.blueemberdesign.com/?p=902</guid>
		<description><![CDATA[A look into the decision between using PPC  vs. SEO marketing and which could the best fit for your company


Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/07/13/4-reasons-to-have-a-company-blog/' rel='bookmark' title='Permanent Link: 4 Reasons To Have a Company Blog'>4 Reasons To Have a Company Blog</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Many companies, especially in the current tough economy, are looking at their marketing budgets and are asking a very important question: <strong>&#8220;Where can we spend our marketing dollars and make the largest impact?&#8221;</strong></p>
<p>When making this decision it&#8217;s important to consider that both PPC advertising and SEO have their merits.  At the same time, they also have dissimilar levels of commitment (both in time and money) and use entirely different methods for determining their success.  We&#8217;ll look into those differences here in an effort to help in the decision-making process.</p>
<h2>Pay Per Click Advertising</h2>
<p>Advertising online is an easy and quick way to drive traffic to a website.  If executed correctly, traffic will arrive on highly targeted keywords and improve sales conversion rates.  As long as the advertising bills are paid, website traffic should stay at its elevated level.  However, stop paying and they&#8217;ll cut traffic just as fast as it started.</p>
<p><strong>So what does this mean for a company?</strong> It means that pay per click advertising is a great way to instantly generate new traffic.  As long as the campaign is active, the traffic will flow.  This model makes cost per click (CPC) a perfect way to determine the return on investment (ROI) because of its distinct start/stop times and set number of marketing dollars spent.</p>
<p>Unlike pay per click advertising, these lines are not so clear with a search engine optimization campaign.</p>
<h2>Search Engine Optimization</h2>
<p>In most cases, it&#8217;s accurate to say that an SEO marketing campaign with a <strong>high quality search engine optimization company</strong> will result in a lower CPC than a pay per click advertising campaign.  Here&#8217;s why:</p>
<p>Unlike pay per click advertising, search engine optimization is a lasting investment into the quality and success of a company&#8217;s website.  There is no clear end to when an SEO campaign stops being effective. A 12-month campaign with an SEO professional that is halted due to budget issues will continue to exhibit improved results well after the work has entirely stopped.  <strong>Depending on the industry, the competition, and the quality of the SEO, improved results could last for weeks or even potentially years.</strong> Because of the indefinite end to its results, cost per click is not an adequate way to determine the return on investment of an SEO campaign.</p>
<p><strong>If the results are so long-lasting, why isn&#8217;t everyone going with SEO?</strong> Largely because there is a minimum required commitment to search engine optimization.  A campaign can take weeks or months to start showing improved results and even more importantly will require patience, diligence and time to build into a highly successful campaign.  If either time or money are limited, it&#8217;s likely that a pay per click advertising campaign is going to be the best short-term choice.</p>
<h2>So Which is Right For My Company?</h2>
<p>After reading this article, it should hopefully be clear that there are some core differences between how pay per click advertising and search engine optimization work and how their results should be quantified.  Pay per click advertising campaigns have a hard start and end date, immediately drive targeted traffic, and have a simple formula to determine their ROI.  Meanwhile, an SEO campaign may take longer to put into place at a higher initial cost, but the results will long outlast those of PPC advertising.</p>
<p>Want more information or need help? Blue Ember Design can build a quality <a href="/search-engine-optimization/">Search Engine Optimization</a> or <a href="/pay-per-click-advertising/">PPC Advertising</a> campaign for your company.</p>
<img src="http://www.blueemberdesign.com/?ak_action=api_record_view&id=902&type=feed" alt="" />

<p>Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/07/13/4-reasons-to-have-a-company-blog/' rel='bookmark' title='Permanent Link: 4 Reasons To Have a Company Blog'>4 Reasons To Have a Company Blog</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.blueemberdesign.com/blog/2009/10/30/ppc-seo-best-for-company/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gas Mask: Simple Hosts File Manager for OS X</title>
		<link>http://www.blueemberdesign.com/blog/2009/10/05/gas-mask-simple-hosts-file-manager-mac-os-x/</link>
		<comments>http://www.blueemberdesign.com/blog/2009/10/05/gas-mask-simple-hosts-file-manager-mac-os-x/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 22:12:02 +0000</pubDate>
		<dc:creator>Garrett St. John</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[gas mask]]></category>
		<category><![CDATA[hosts]]></category>
		<category><![CDATA[hosts file]]></category>
		<category><![CDATA[hosts file switching]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[profile switching]]></category>

		<guid isPermaLink="false">http://www.blueemberdesign.com/?p=883</guid>
		<description><![CDATA[In doing a considerable amount of local web development, we often come across the need to modify (or even completely swap out) the hosts file on Mac OS X Leopard. Check out how we do it


Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/08/25/codeigniter-file-upload-changing-the-file-name/' rel='bookmark' title='Permanent Link: CodeIgniter File Upload: Changing the File Name'>CodeIgniter File Upload: Changing the File Name</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/07/29/codeigniter-file-upload-setting-disallowed-file-types/' rel='bookmark' title='Permanent Link: CodeIgniter File Upload: Setting Disallowed File Types'>CodeIgniter File Upload: Setting Disallowed File Types</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-884" title="gas-mask" src="http://www.blueemberdesign.com/wp-content/uploads/2009/10/gas-mask.jpg" alt="gas-mask" width="470" height="157" /></p>
<p>In doing a considerable amount of local web development, we often come across the need to modify (or even completely swap out) the hosts file on Mac OS X Leopard.  While it is possible to do this <a href="http://decoding.wordpress.com/2009/04/06/how-to-edit-the-hosts-file-in-mac-os-x-leopard/">through the terminal</a>, there is a great little tool from <a href="http://www.clockwise.ee/">Clockwise</a> that works perfectly called <a href="http://www.apple.com/downloads/macosx/development_tools/gasmask.html">Gas Mask</a>.</p>
<p><strong>Features:</strong></p>
<ul>
<li>Syntax highlighting</li>
<li>Simple hosts file switching</li>
<li>Global hotkeys for file switching</li>
<li>Automatic flushing of the local DNS cache</li>
<li>Growl support</li>
</ul>
<p>Gas Mask is currently at version 0.4 and can be downloaded for free on the <a href="http://www.apple.com/downloads/macosx/development_tools/gasmask.html">Apple Downloads</a> site. Enjoy!</p>
<img src="http://www.blueemberdesign.com/?ak_action=api_record_view&id=883&type=feed" alt="" />

<p>Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/08/25/codeigniter-file-upload-changing-the-file-name/' rel='bookmark' title='Permanent Link: CodeIgniter File Upload: Changing the File Name'>CodeIgniter File Upload: Changing the File Name</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/07/29/codeigniter-file-upload-setting-disallowed-file-types/' rel='bookmark' title='Permanent Link: CodeIgniter File Upload: Setting Disallowed File Types'>CodeIgniter File Upload: Setting Disallowed File Types</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.blueemberdesign.com/blog/2009/10/05/gas-mask-simple-hosts-file-manager-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Design Roundup: Stuff We Like – Issue #3</title>
		<link>http://www.blueemberdesign.com/blog/2009/09/10/design-roundup-stuff-we-like-3/</link>
		<comments>http://www.blueemberdesign.com/blog/2009/09/10/design-roundup-stuff-we-like-3/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 15:00:42 +0000</pubDate>
		<dc:creator>Garrett St. John</dc:creator>
				<category><![CDATA[Design Roundup]]></category>
		<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[mailchimp]]></category>
		<category><![CDATA[squarespace]]></category>
		<category><![CDATA[Weekly Design Roundup]]></category>

		<guid isPermaLink="false">http://www.blueemberdesign.com/?p=587</guid>
		<description><![CDATA[The Design Roundup is a collection of our favorite designs we’ve come across lately. This time we have great designs from CodeIgniter, MailChimp, and Squarespace.
CodeIgniter
http://codeigniter.com &#8211; At Blue Ember Design, CodeIgniter is our MVC of choice when building custom web application.  Not only does EllisLabs offer great software, their site design is great too.  We [...]


Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/07/24/design-roundup-stuff-we-like-2/' rel='bookmark' title='Permanent Link: Design Roundup: Stuff We Like &#8211; Issue #2'>Design Roundup: Stuff We Like &#8211; Issue #2</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/07/10/design-roundup-stuff-we-like-1/' rel='bookmark' title='Permanent Link: Design Roundup: Stuff We Like &#8211; Issue #1'>Design Roundup: Stuff We Like &#8211; Issue #1</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/08/17/announcing-the-codeigniter-dreamhost-api-library/' rel='bookmark' title='Permanent Link: Announcing the CodeIgniter Dreamhost API Library'>Announcing the CodeIgniter Dreamhost API Library</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The Design Roundup is a collection of our favorite designs we’ve come across lately. This time we have great designs from CodeIgniter, MailChimp, and Squarespace.</p>
<h2>CodeIgniter</h2>
<p><img class="alignnone size-full wp-image-852" title="codeigniter" src="http://www.blueemberdesign.com/wp-content/uploads/2009/09/codeigniter.jpg" alt="codeigniter" width="470" height="348" /><a href="http://codeigniter.com">http://codeigniter.com</a> &#8211; At Blue Ember Design, <a href="http://www.blueemberdesign.com/codeigniter-development/">CodeIgniter</a> is our MVC of choice when building custom web application.  Not only does EllisLabs offer great software, their site design is great too.  We love the reds and oranges as well as the clear presentation of their message.</p>
<h2>MailChimp</h2>
<p><img class="alignnone size-full wp-image-853" title="mailchimp" src="http://www.blueemberdesign.com/wp-content/uploads/2009/09/mailchimp.jpg" alt="mailchimp" width="470" height="348" /><br />
<a href="http://www.mailchimp.com">http://www.mailchimp.com</a> &#8211; While Blue Ember Design does offer our own <a href="http://www.blueemberdesign.com/email-marketing/">email marketing services</a>, MailChimp cannot go without recognition.  Their site is clear and easy to use.  Also, their mascot is well illustrated and they have a great sense of humor.</p>
<h2>Squarespace</h2>
<p><img class="alignnone size-full wp-image-854" title="squarespace" src="http://www.blueemberdesign.com/wp-content/uploads/2009/09/squarespace.jpg" alt="squarespace" width="470" height="348" /><br />
<a href="http://www.squarespace.com">http://www.squarespace.com</a> &#8211; Squarespace is a nice tool for blogging or can even be used as a CMS.  Their website is just so sleek.  Great use of typography and we love just how crisp every part of the design feels.  Two thumbs up!</p>
<img src="http://www.blueemberdesign.com/?ak_action=api_record_view&id=587&type=feed" alt="" />

<p>Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/07/24/design-roundup-stuff-we-like-2/' rel='bookmark' title='Permanent Link: Design Roundup: Stuff We Like &#8211; Issue #2'>Design Roundup: Stuff We Like &#8211; Issue #2</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/07/10/design-roundup-stuff-we-like-1/' rel='bookmark' title='Permanent Link: Design Roundup: Stuff We Like &#8211; Issue #1'>Design Roundup: Stuff We Like &#8211; Issue #1</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/08/17/announcing-the-codeigniter-dreamhost-api-library/' rel='bookmark' title='Permanent Link: Announcing the CodeIgniter Dreamhost API Library'>Announcing the CodeIgniter Dreamhost API Library</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.blueemberdesign.com/blog/2009/09/10/design-roundup-stuff-we-like-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beautiful Color Scheme Generator for Design Work</title>
		<link>http://www.blueemberdesign.com/blog/2009/09/08/beautiful-color-scheme-generator-for-design-work/</link>
		<comments>http://www.blueemberdesign.com/blog/2009/09/08/beautiful-color-scheme-generator-for-design-work/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 15:00:23 +0000</pubDate>
		<dc:creator>Garrett St. John</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[color scheme]]></category>
		<category><![CDATA[colour scheme]]></category>
		<category><![CDATA[generator color]]></category>
		<category><![CDATA[hex color]]></category>
		<category><![CDATA[palette]]></category>
		<category><![CDATA[scheme designer]]></category>
		<category><![CDATA[scheme generator]]></category>

		<guid isPermaLink="false">http://www.blueemberdesign.com/?p=834</guid>
		<description><![CDATA[It seems there is an endless supply of color scheme tools available both on the web and as installable applications. Recently, however, we came across what is now our favorite color scheme generator in Color Scheme Designer 3


Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/07/03/3-methods-building-great-color-scheme/' rel='bookmark' title='Permanent Link: 3 Methods For Building a Great Color Scheme'>3 Methods For Building a Great Color Scheme</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It seems there is an endless supply of color scheme tools available both on the web and as installable applications.  Recently, however, we came across what is now our favorite color scheme generator in <a href="http://colorschemedesigner.com/">Color Scheme Designer 3</a>.  It&#8217;s great for design inspiration or just to toy with for hours on end.</p>
<p><img class="alignnone size-full wp-image-837" title="color-schemer" src="http://www.blueemberdesign.com/wp-content/uploads/2009/09/color-schemer.jpg" alt="color-schemer" width="470" height="304" /></p>
<h2>Top Features</h2>
<ul>
<li>Beautiful and simple web-based interface</li>
<li>Offers mono, complementary, triad, tetrad, analogic, and accented analogic color schemes</li>
<li>Simple color wheel for easy base color selection</li>
<li>Allows for adjustments to the selected color scheme (i.e. max contrast, light pastel, and 20+ more adjustments)</li>
<li>Lists all resulting hex color codes from the full color scheme</li>
<li>Preview on a light and dark sample web page</li>
<li>Export the color scheme to HTML+CSS, Photoshop palette, and others</li>
<li>Completely free to use (donations accepted)!</li>
</ul>
<p>If you are looking for a quality color scheme generator, definitely check out <a href="http://colorschemedesigner.com/">Color Scheme Designer 3</a>.  What other generators have you used in the past and found good success in using?</p>
<img src="http://www.blueemberdesign.com/?ak_action=api_record_view&id=834&type=feed" alt="" />

<p>Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/07/03/3-methods-building-great-color-scheme/' rel='bookmark' title='Permanent Link: 3 Methods For Building a Great Color Scheme'>3 Methods For Building a Great Color Scheme</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.blueemberdesign.com/blog/2009/09/08/beautiful-color-scheme-generator-for-design-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter File Upload: Changing the File Name</title>
		<link>http://www.blueemberdesign.com/blog/2009/08/25/codeigniter-file-upload-changing-the-file-name/</link>
		<comments>http://www.blueemberdesign.com/blog/2009/08/25/codeigniter-file-upload-changing-the-file-name/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 08:00:56 +0000</pubDate>
		<dc:creator>Garrett St. John</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[extending]]></category>
		<category><![CDATA[file name]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[files codeigniter]]></category>
		<category><![CDATA[upload library]]></category>

		<guid isPermaLink="false">http://www.blueemberdesign.com/?p=767</guid>
		<description><![CDATA[There has been some interest lately on our blog about how to change the file name of uploaded files with CodeIgniter.  We will review how to do this with the base File Upload library as well as extending the library to allow for a defined file name


Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/08/03/common-issues-codeigniter-file-upload/' rel='bookmark' title='Permanent Link: Common Issues with CodeIgniter File Upload'>Common Issues with CodeIgniter File Upload</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/07/29/codeigniter-file-upload-setting-disallowed-file-types/' rel='bookmark' title='Permanent Link: CodeIgniter File Upload: Setting Disallowed File Types'>CodeIgniter File Upload: Setting Disallowed File Types</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2010/02/23/ftp-download-codeigniter-library/' rel='bookmark' title='Permanent Link: FTP Download with the CodeIgniter FTP Library'>FTP Download with the CodeIgniter FTP Library</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong>: As of version 1.7.2, CodeIgniter now has a built-in option to specify the uploaded file name.  Placed in the $config array, &#8216;file_name&#8217; sets the desired end name and should be provided without an extension.  The extension will be carried across from the original file.</p>
<p>&#8212;&#8212;</p>
<p>There has been some interest lately on our blog about how to change the file name of uploaded files with CodeIgniter.  We will review how to do this with the <strong>base File Upload library</strong> as well as <strong>extending the library</strong> to allow for a defined file name.</p>
<h2>Using the Base File Upload Library</h2>
<p>The base file upload library has a built-in option to &#8220;encrypt&#8221; the file name for a freshly uploaded file.  According to the <a href="http://codeigniter.com/user_guide/libraries/file_uploading.html">documentation</a>, that option is &#8216;encrypt_name&#8217; and takes a Boolean value.  If set to TRUE, the file name is renamed by running it through this set of functions:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$filename</span> <span style="color: #339933;">=</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">uniqid</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mt_rand</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_ext</span><span style="color: #339933;">;</span></pre></div></div>

<p>This essentially generates a nice random MD5 hash that will likely not collide with other files in your directory.  Most of the time this method for renaming will work just fine, but what if we want to specify the name rather than have it random?</p>
<h2>Extending the File Upload Library</h2>
<p>This method involves extending the base library which we have done before for <a href="http://www.blueemberdesign.com/blog/2009/07/29/codeigniter-file-upload-setting-disallowed-file-types/">other file upload customizations</a>.  In this method, the do_upload() function accepts a file name and applies it to the file.  Here is the code used to accomplish that outcome:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> do_upload<span style="color: #009900;">&#40;</span><span style="color: #000088;">$field</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'userfile'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$new_name</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload_no_file_selected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validate_upload_path</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #990000;">is_uploaded_file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'tmp_name'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'error'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #cc66cc;">4</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'error'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$error</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// UPLOAD_ERR_INI_SIZE</span>
          <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload_file_exceeds_limit'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// UPLOAD_ERR_FORM_SIZE</span>
          <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload_file_exceeds_form_limit'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// UPLOAD_ERR_PARTIAL</span>
           <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload_file_partial'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// UPLOAD_ERR_NO_FILE</span>
           <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload_no_file_selected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">6</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// UPLOAD_ERR_NO_TMP_DIR</span>
          <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload_no_temp_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">7</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// UPLOAD_ERR_CANT_WRITE</span>
          <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload_unable_to_write_file'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">// UPLOAD_ERR_EXTENSION</span>
          <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload_stopped_by_extension'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">default</span> <span style="color: #339933;">:</span>
          <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload_no_file_selected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_temp</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'tmp_name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_size</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'size'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_type</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/^(.+?);.*$/&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>1&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_type</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_type</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_ext</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_extension</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// check if a name has been specified, if so set it</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$new_name</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_prep_filename<span style="color: #009900;">&#40;</span><span style="color: #000088;">$new_name</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_ext</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_prep_filename<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_size</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_size</span> <span style="color: #339933;">=</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_size</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">1024</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">is_allowed_filetype</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload_invalid_filetype'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">is_allowed_filesize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload_invalid_filesize'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">is_allowed_dimensions</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload_invalid_dimensions'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">clean_file_name</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">max_filename</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">limit_filename_length</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">max_filename</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">remove_spaces</span> <span style="color: #339933;">==</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\s+/&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;_&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">orig_name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">overwrite</span> <span style="color: #339933;">==</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_filename</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">upload_path</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #339933;">@</span><span style="color: #990000;">copy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_temp</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">upload_path</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #339933;">@</span><span style="color: #990000;">move_uploaded_file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_temp</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">upload_path</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
         <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload_destination_error'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">xss_clean</span> <span style="color: #339933;">==</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">do_xss_clean</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_image_properties</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">upload_path</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">file_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Much of this code is taken from the existing File Upload library, but is provided above for the sake of completeness.  Comments have been removed to shorten it up a bit, but can be found in the original Upload.php for further understanding.</p>
<p>The file name can be set in the controller by calling the do_upload() function as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">upload</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">do_upload</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'form_field_name'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'new_file_name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>With this extended File Upload library, the following circumstances exist:</p>
<ol>
<li>The file name provided in do_upload() <strong>should not</strong> have an extension. The extension from the original file will be applied.</li>
<li>If &#8216;encrypt_name&#8217; is set in $config, it will take precedence over the specified file name.</li>
</ol>
<p>Have any other tips for changing the file name for uploaded files in CodeIgniter?  Share it in the comments!</p>
<img src="http://www.blueemberdesign.com/?ak_action=api_record_view&id=767&type=feed" alt="" />

<p>Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/08/03/common-issues-codeigniter-file-upload/' rel='bookmark' title='Permanent Link: Common Issues with CodeIgniter File Upload'>Common Issues with CodeIgniter File Upload</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/07/29/codeigniter-file-upload-setting-disallowed-file-types/' rel='bookmark' title='Permanent Link: CodeIgniter File Upload: Setting Disallowed File Types'>CodeIgniter File Upload: Setting Disallowed File Types</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2010/02/23/ftp-download-codeigniter-library/' rel='bookmark' title='Permanent Link: FTP Download with the CodeIgniter FTP Library'>FTP Download with the CodeIgniter FTP Library</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.blueemberdesign.com/blog/2009/08/25/codeigniter-file-upload-changing-the-file-name/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing the CodeIgniter Dreamhost API Library</title>
		<link>http://www.blueemberdesign.com/blog/2009/08/17/announcing-the-codeigniter-dreamhost-api-library/</link>
		<comments>http://www.blueemberdesign.com/blog/2009/08/17/announcing-the-codeigniter-dreamhost-api-library/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 21:00:51 +0000</pubDate>
		<dc:creator>Garrett St. John</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[api library]]></category>
		<category><![CDATA[codeigniter dreamhost]]></category>
		<category><![CDATA[codeigniter library]]></category>
		<category><![CDATA[dreamhost]]></category>
		<category><![CDATA[dreamhost api]]></category>
		<category><![CDATA[library]]></category>

		<guid isPermaLink="false">http://www.blueemberdesign.com/?p=747</guid>
		<description><![CDATA[Today we are announcing the release of a Dreamhost API library for CodeIgniter.  The API lets you integrate common Dreamhost Panel activities into your web applications.  Enjoy!


Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/07/29/codeigniter-file-upload-setting-disallowed-file-types/' rel='bookmark' title='Permanent Link: CodeIgniter File Upload: Setting Disallowed File Types'>CodeIgniter File Upload: Setting Disallowed File Types</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/08/03/common-issues-codeigniter-file-upload/' rel='bookmark' title='Permanent Link: Common Issues with CodeIgniter File Upload'>Common Issues with CodeIgniter File Upload</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2010/02/23/ftp-download-codeigniter-library/' rel='bookmark' title='Permanent Link: FTP Download with the CodeIgniter FTP Library'>FTP Download with the CodeIgniter FTP Library</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As we&#8217;ve said many times before, we are avid <a href="http://www.blueemberdesign.com/codeigniter-development/">CodeIgniter developers</a> at Blue Ember Design.  The framework is fluid and light-weight and the developer community is great.</p>
<p>We&#8217;ve been inspired many times by the extensive list of <a href="http://www.haughin.com/code/">CodeIgniter libraries provided by Elliot Haughin</a> and decided we ought to follow in his footsteps with a great new API library.</p>
<p>Today we are announcing the release of a <a href="http://www.blueemberdesign.com/codeigniter-dreamhost-api-library/">Dreamhost API library for CodeIgniter</a>.  The API lets you integrate common Dreamhost Panel activities into your web applications.  With this library, you can integrate tasks like announcement list management and Dreamhost PS resizing right into your CodeIgniter applications.  Pretty great!</p>
<p>We&#8217;d love to hear feedback about the library, how you are using it, and if you have any suggestions.  Enjoy!</p>
<p><a href="http://www.blueemberdesign.com/codeigniter-dreamhost-api-library/">Get the CodeIgniter Dreamhost API Library Here</a></p>
<img src="http://www.blueemberdesign.com/?ak_action=api_record_view&id=747&type=feed" alt="" />

<p>Related Posts:<ol><li><a href='http://www.blueemberdesign.com/blog/2009/07/29/codeigniter-file-upload-setting-disallowed-file-types/' rel='bookmark' title='Permanent Link: CodeIgniter File Upload: Setting Disallowed File Types'>CodeIgniter File Upload: Setting Disallowed File Types</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2009/08/03/common-issues-codeigniter-file-upload/' rel='bookmark' title='Permanent Link: Common Issues with CodeIgniter File Upload'>Common Issues with CodeIgniter File Upload</a></li>
<li><a href='http://www.blueemberdesign.com/blog/2010/02/23/ftp-download-codeigniter-library/' rel='bookmark' title='Permanent Link: FTP Download with the CodeIgniter FTP Library'>FTP Download with the CodeIgniter FTP Library</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.blueemberdesign.com/blog/2009/08/17/announcing-the-codeigniter-dreamhost-api-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
