<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Serving PDF Files through Symfony Controllers</title>
	<atom:link href="http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/</link>
	<description>Timo Haberkern blogs about symfony</description>
	<lastBuildDate>Mon, 16 Jan 2012 21:55:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Tam</title>
		<link>http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/comment-page-1/#comment-6198</link>
		<dc:creator>Tam</dc:creator>
		<pubDate>Tue, 11 Jan 2011 14:39:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/#comment-6198</guid>
		<description>thank you sir, 

I&#039;m looking for a way to write an image to the controller response. this seems to be what I need.</description>
		<content:encoded><![CDATA[<p>thank you sir, </p>
<p>I&#8217;m looking for a way to write an image to the controller response. this seems to be what I need.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oscar B.</title>
		<link>http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/comment-page-1/#comment-5557</link>
		<dc:creator>Oscar B.</dc:creator>
		<pubDate>Wed, 08 Dec 2010 21:28:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/#comment-5557</guid>
		<description>Delicious-ed &gt;B

Thanks a lot, just what I needed, and it worked on first try!!!!!!!!!!
haha!!</description>
		<content:encoded><![CDATA[<p>Delicious-ed &gt;B</p>
<p>Thanks a lot, just what I needed, and it worked on first try!!!!!!!!!!<br />
haha!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prasad</title>
		<link>http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/comment-page-1/#comment-4610</link>
		<dc:creator>Prasad</dc:creator>
		<pubDate>Sat, 28 Aug 2010 14:23:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/#comment-4610</guid>
		<description>Thanks, and very valid point raised by Sean</description>
		<content:encoded><![CDATA[<p>Thanks, and very valid point raised by Sean</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/comment-page-1/#comment-3722</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Tue, 13 Apr 2010 15:53:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/#comment-3722</guid>
		<description>Great article Timo! Thanks a lot :-) Keep them coming, symfony is great.</description>
		<content:encoded><![CDATA[<p>Great article Timo! Thanks a lot <img src='http://www.symfony-zone.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Keep them coming, symfony is great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kristof Taveirne</title>
		<link>http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/comment-page-1/#comment-3095</link>
		<dc:creator>Kristof Taveirne</dc:creator>
		<pubDate>Sat, 02 Jan 2010 17:01:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/#comment-3095</guid>
		<description>ALL RIGHT!
Thanks a lot!

Exactly what I was looking for!</description>
		<content:encoded><![CDATA[<p>ALL RIGHT!<br />
Thanks a lot!</p>
<p>Exactly what I was looking for!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/comment-page-1/#comment-3057</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Wed, 23 Dec 2009 16:19:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/#comment-3057</guid>
		<description>There&#039;s a potential security hole here that you may want to be wary of - the file path you accept is handed straight from the user... this is dangerous!

For example, say I visited 
http://domain/media/..%2Fconfig%2Fdatabases.yml/download/1

Your script would then push out the content of your database config file - including your DB username, password, and domain!  And then they can do all sorts of malicious things.

Essentially, since you&#039;re not filtering your files and just concatenating it with the directory path, it&#039;s possible to use &quot;..&quot; to navigate around the file system, and choose any file you want.


A better option is to provide some sort of restricted key that maps to a file path.  That way, you have very tight control over which files will be served.

Happy coding!</description>
		<content:encoded><![CDATA[<p>There&#8217;s a potential security hole here that you may want to be wary of &#8211; the file path you accept is handed straight from the user&#8230; this is dangerous!</p>
<p>For example, say I visited<br />
<a href="http://domain/media/..%2Fconfig%2Fdatabases.yml/download/1" rel="nofollow">http://domain/media/..%2Fconfig%2Fdatabases.yml/download/1</a></p>
<p>Your script would then push out the content of your database config file &#8211; including your DB username, password, and domain!  And then they can do all sorts of malicious things.</p>
<p>Essentially, since you&#8217;re not filtering your files and just concatenating it with the directory path, it&#8217;s possible to use &#8220;..&#8221; to navigate around the file system, and choose any file you want.</p>
<p>A better option is to provide some sort of restricted key that maps to a file path.  That way, you have very tight control over which files will be served.</p>
<p>Happy coding!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seb.</title>
		<link>http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/comment-page-1/#comment-2807</link>
		<dc:creator>Seb.</dc:creator>
		<pubDate>Mon, 16 Nov 2009 14:15:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/#comment-2807</guid>
		<description>Nice wrap up. You might also set the headers in the template:

$sf_response-&gt;clearHttpHeaders();
$sf_response-&gt;setContentType(&#039;application/pdf&#039;);
$sf_response-&gt;setHttpHeader(&#039;Content-Disposition&#039;, &#039;attachment; filename=&#039; . $pdfFileName);

readfile($pdfFilePath);</description>
		<content:encoded><![CDATA[<p>Nice wrap up. You might also set the headers in the template:</p>
<p>$sf_response-&gt;clearHttpHeaders();<br />
$sf_response-&gt;setContentType(&#8216;application/pdf&#8217;);<br />
$sf_response-&gt;setHttpHeader(&#8216;Content-Disposition&#8217;, &#8216;attachment; filename=&#8217; . $pdfFileName);</p>
<p>readfile($pdfFilePath);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hassan</title>
		<link>http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/comment-page-1/#comment-2693</link>
		<dc:creator>Hassan</dc:creator>
		<pubDate>Mon, 26 Oct 2009 03:01:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/#comment-2693</guid>
		<description>Thank you very much for these clear explanations!

Exactly what I needed :D</description>
		<content:encoded><![CDATA[<p>Thank you very much for these clear explanations!</p>
<p>Exactly what I needed <img src='http://www.symfony-zone.com/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: News from the world of Symfony - September 2009</title>
		<link>http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/comment-page-1/#comment-2514</link>
		<dc:creator>News from the world of Symfony - September 2009</dc:creator>
		<pubDate>Tue, 29 Sep 2009 01:51:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/#comment-2514</guid>
		<description>[...] them privately, or share them. The files, of course, need to be stored out of the document root. I found this article by Timo Haberkern of Symfony Zone very helpful: As we now use a Symfony-Controller you can do just use the complete Symfony infrastructure. You [...]</description>
		<content:encoded><![CDATA[<p>[...] them privately, or share them. The files, of course, need to be stored out of the document root. I found this article by Timo Haberkern of Symfony Zone very helpful: As we now use a Symfony-Controller you can do just use the complete Symfony infrastructure. You [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aro</title>
		<link>http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/comment-page-1/#comment-2292</link>
		<dc:creator>Aro</dc:creator>
		<pubDate>Thu, 27 Aug 2009 01:02:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.symfony-zone.com/wordpress/2009/08/03/serving-pdf-files-through-symfony-controllers/#comment-2292</guid>
		<description>thx, it&#039;s Exactly what i need!! I&#039;m changing from java to php and symfony and I really need that. thx again</description>
		<content:encoded><![CDATA[<p>thx, it&#8217;s Exactly what i need!! I&#8217;m changing from java to php and symfony and I really need that. thx again</p>
]]></content:encoded>
	</item>
</channel>
</rss>

