<?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>Universal Web Services Blog</title>
	<atom:link href="http://www.universalwebservices.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.universalwebservices.net/blog</link>
	<description>Documenting our development experiences</description>
	<lastBuildDate>Tue, 28 Sep 2010 14:44:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Exporting to CSV or TSV with PHP</title>
		<link>http://www.universalwebservices.net/blog/exporting-to-csv-or-tsv-with-php/</link>
		<comments>http://www.universalwebservices.net/blog/exporting-to-csv-or-tsv-with-php/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 12:53:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[php csv export]]></category>
		<category><![CDATA[php tsv export]]></category>

		<guid isPermaLink="false">http://www.universalwebservices.net/blog/?p=11</guid>
		<description><![CDATA[Exporting to a CSV (comma-separated values) or TSV (tab-separated values) file with PHP is relatively simple with the combined use of: Content headers Formatted Printing Below, I&#39;ll show you an example which combines the two elements above with a database &#8230; <a href="http://www.universalwebservices.net/blog/exporting-to-csv-or-tsv-with-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Exporting to a CSV (comma-separated values) or TSV (tab-separated values) file with PHP is relatively simple with the combined use of:</p>
<ul>
<li>Content headers</li>
<li>Formatted Printing</li>
</ul>
<p>Below, I&#39;ll show you an example which combines the two elements above with a database query:</p>
<p>Notes:</p>
<ul>
<li>Notice the format in <em>printf</em>.&nbsp; We&#39;re using <em>%s</em> to represent a string, and <em>\t </em>as an escape character to represent a TAB</li>
<li>We&#39;re assuming that you&#39;ve already setup a database connection with mysql_connect.</li>
</ul>
<p>&nbsp;</p>
<p><code>&lt;?php</p>
<p>	<code>header(&quot;Content-Disposition: attachment; filename=\&quot;quotes.tsv\&quot;&quot;); <br />
	header(&quot;Content-Type: text/tab-delimited-values&quot;);<br />
	&nbsp;<br />
	</code> <code>$sql = &quot;SELECT <br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; client, <br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; address,<br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; city,<br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; state,<br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; postal,<br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; phone,<br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; email<br />
	&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; FROM quote&quot;;<br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />
	</code> <code>$res = mysql_query($sql, $connection)</p>
<p>	<code>echo &quot;Client\tAddress\tCity\tState\tZip\tPhone\tE-Mail\n&quot;;</p>
<p>	</code> <code>while ($row = mysql_fetch_array($res)) {</p>
<p><code><br />
	&nbsp;&nbsp;&nbsp; printf(&quot;%s\t%s\t%s\t%s\t%s\t%s\t%s\n&quot;,<br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $row[&#39;client&#39;],<br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $row[&#39;address&#39;],<br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $row[&#39;city&#39;],<br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $row[&#39;state&#39;],<br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $row[&#39;postal&#39;],<br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $row[&#39;phone&#39;],<br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $row[&#39;email&#39;],<br />
	&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; );<br />
	&nbsp;&nbsp;&nbsp; <br />
	}</p>
<p>	</code> <code>?&gt;<br />
	</code></code></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.universalwebservices.net/blog/exporting-to-csv-or-tsv-with-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ColdFusion PDF Exports</title>
		<link>http://www.universalwebservices.net/blog/coldfusion-pdf-exports/</link>
		<comments>http://www.universalwebservices.net/blog/coldfusion-pdf-exports/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 21:34:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[coldfusion pdf]]></category>

		<guid isPermaLink="false">http://www.universalwebservices.net/blog/?p=8</guid>
		<description><![CDATA[ColdFusion 7 and up makes it extremely easy to generate PDFs on the fly using the CFDocument tag, but it only offers the option of saving to a file, or streaming to the browser. If you want additional control, combine &#8230; <a href="http://www.universalwebservices.net/blog/coldfusion-pdf-exports/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>ColdFusion 7 and up makes it extremely easy to generate PDFs on the fly using the <a href="http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_d-e_05.html">CFDocument</a> tag, but it only offers the option of saving to a file, or streaming to the browser. If you want additional control, combine CFDocument with CFHeader as follows: </p>
<p><code>&lt;cfcontent type=&quot;application/pdf&quot;&gt; <br />
	&lt;cfheader name=&quot;Content-Disposition&quot; value=&quot;attachment;filename=export.pdf&quot;&gt;</code> </p>
<p><code>&lt;cfdocument format=&quot;PDF&quot;&gt; <br />
	&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt; <br />
	&lt;html&gt; <br />
	&lt;head&gt; <br />
	&nbsp;&nbsp;&nbsp; &lt;title&gt;Hello World&lt;/title&gt; <br />
	&lt;/head&gt; <br />
	&lt;body&gt; </code><code><br />
	&nbsp;&nbsp;&nbsp; Hello World </code><code><br />
	&lt;/body&gt;<br />
	&lt;/html&gt;<br />
	&lt;/cfdocument&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.universalwebservices.net/blog/coldfusion-pdf-exports/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ColdFusion CFZip file permissions</title>
		<link>http://www.universalwebservices.net/blog/coldfusion-cfzip-file-permissions/</link>
		<comments>http://www.universalwebservices.net/blog/coldfusion-cfzip-file-permissions/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 17:03:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[cfzip]]></category>
		<category><![CDATA[coldfusion]]></category>

		<guid isPermaLink="false">http://www.universalwebservices.net/blog/?p=5</guid>
		<description><![CDATA[Those familiar with the CFZip tag know that it doesn&#39;t offer the &#34;mode&#34; attribute as CFFile does. This presents a problem when storing a zip file on the file system, especially when the need arises to overwrite that zip file. &#8230; <a href="http://www.universalwebservices.net/blog/coldfusion-cfzip-file-permissions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Those familiar with the CFZip tag know that it doesn&#39;t offer the &quot;mode&quot; attribute as CFFile does. This presents a problem when storing a zip file on the file system, especially when the need arises to overwrite that zip file. The solution we&#39;ve come up with is to first use CFFile to create an empty file, and make it writeable. <code> </code></p>
<p><code>&lt;cffile action=&quot;write&quot; file=&quot;#mypath#/#myfile#.zip&quot; output=&quot; &quot; mode=&quot;777&quot;&gt;</code></p>
<p><code>&lt;cfzip file=&quot;#mypath#/#myfile#.zip&quot; action=&quot;zip&quot; overwrite=&quot;true&quot;&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.universalwebservices.net/blog/coldfusion-cfzip-file-permissions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

