<?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>Techie Gyaaan &#187; C#</title>
	<atom:link href="http://techie.gyaaan.com/category/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://techie.gyaaan.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 15 May 2009 15:19:40 +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>How to prompt &#8216;Save as&#8217; for a known MIME type in C#</title>
		<link>http://techie.gyaaan.com/how-to-prompt-save-as-for-a-known-mime-type-in-c/</link>
		<comments>http://techie.gyaaan.com/how-to-prompt-save-as-for-a-known-mime-type-in-c/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 10:49:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[MIME]]></category>
		<category><![CDATA[Save As]]></category>

		<guid isPermaLink="false">http://techie.gyaaan.com/?p=60</guid>
		<description><![CDATA[Thanks to Ratheesh PK &#8211; Technical Lead &#8211; Sakhatech Information Systems Pvt Ltd, Code snippet in ASP.NET/C# to prompt browser ‘Save as’ for known MIME types. Response.Clear(); Response.ContentType = &#8220;application/x-unknown&#8221;; string fileName = &#8220;file.jpg&#8221;; string filePath = &#8220;d:\\&#8221; + fileName; Response.AddHeader(&#8220;Content-Disposition&#8221;,&#8221;attachment; filename=&#8221; + fileName ); FileStream fs = File.OpenRead(filePath); BinaryReader br = new BinaryReader(fs); Response.BinaryWrite(br.ReadBytes(Convert.ToInt32(fs.Length))); [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to Ratheesh PK &#8211; Technical Lead &#8211; <a href="http://sakhatech.com">Sakhatech Information Systems Pvt Ltd</a>,</p>
<p><strong>Code snippet in ASP.NET/C# to prompt browser ‘Save as’ for known MIME types.</strong></p>
<p>  Response.Clear();<br />
  Response.ContentType = &#8220;application/x-unknown&#8221;;<br />
        string fileName = &#8220;file.jpg&#8221;;<br />
        string filePath = &#8220;d:\\&#8221; + fileName;<br />
        Response.AddHeader(&#8220;Content-Disposition&#8221;,&#8221;attachment; filename=&#8221; + fileName );<br />
        FileStream fs = File.OpenRead(filePath);<br />
        BinaryReader br = new BinaryReader(fs);<br />
        Response.BinaryWrite(br.ReadBytes(Convert.ToInt32(fs.Length)));<br />
        Response.End();</p>
]]></content:encoded>
			<wfw:commentRss>http://techie.gyaaan.com/how-to-prompt-save-as-for-a-known-mime-type-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

