<?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>「[PHP] 下載檔案時無法直接開啟文件的解法方法」的迴響</title>
	<atom:link href="http://www.neo.com.tw/archives/322/feed" rel="self" type="application/rss+xml" />
	<link>http://www.neo.com.tw/archives/322</link>
	<description>Neo 's Blog</description>
	<lastBuildDate>Fri, 27 Jan 2012 12:20:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>由：billing</title>
		<link>http://www.neo.com.tw/archives/322/comment-page-1#comment-1615</link>
		<dc:creator>billing</dc:creator>
		<pubDate>Wed, 12 Mar 2008 03:21:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.neo.vomosa.com/blog/?p=322#comment-1615</guid>
		<description>唔～找到這邊。
想請問，有沒有「反過來」，
就是不跳出「是否開啟或儲存這個檔案」的dialog，
直接就開啟excel / ppt / word 的方法呢？

pdf &amp; jpg都可以，但是就office的不行。

謝謝！
</description>
		<content:encoded><![CDATA[<p>唔～找到這邊。<br />
想請問，有沒有「反過來」，<br />
就是不跳出「是否開啟或儲存這個檔案」的dialog，<br />
直接就開啟excel / ppt / word 的方法呢？</p>
<p>pdf &#038; jpg都可以，但是就office的不行。</p>
<p>謝謝！</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：yuki</title>
		<link>http://www.neo.com.tw/archives/322/comment-page-1#comment-1614</link>
		<dc:creator>yuki</dc:creator>
		<pubDate>Tue, 04 Sep 2007 23:50:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.neo.vomosa.com/blog/?p=322#comment-1614</guid>
		<description>我也遇到這個問題，excel&quot;突然&quot;不能在yahoo mail真接開啟，也試過用其他電腦開啟，但也不能，為甚麼﹖你上述所說的php我也不明白是甚麼﹖可否幫幫我﹖
</description>
		<content:encoded><![CDATA[<p>我也遇到這個問題，excel"突然"不能在yahoo mail真接開啟，也試過用其他電腦開啟，但也不能，為甚麼﹖你上述所說的php我也不明白是甚麼﹖可否幫幫我﹖</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：Cheung</title>
		<link>http://www.neo.com.tw/archives/322/comment-page-1#comment-1613</link>
		<dc:creator>Cheung</dc:creator>
		<pubDate>Sat, 28 Jul 2007 21:26:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.neo.vomosa.com/blog/?p=322#comment-1613</guid>
		<description>this my php file :
session_start();
$pschk = $_POST[&#039;pschk&#039;];
$subroot = $_POST[&#039;subroot&#039;];
$filen = $_POST[&#039;filen&#039;];
$ofile = $_POST[&#039;ofile&#039;];
$tcode = $_POST[&#039;tcode&#039;];
$qaz = $_POST[&#039;qaz&#039;];
$qaz = $_POST[&#039;qaz&#039;];
$wsx = $_POST[&#039;wsx&#039;];
$edc = $_POST[&#039;edc&#039;];
$rfv = $_POST[&#039;rfv&#039;];
$tgb = $_POST[&#039;tgb&#039;];
$dt = $_POST[&#039;dt&#039;];
if (md5($pschk) == $_SESSION[&#039;image_random_value&#039;])
{
if (md5($qaz) == $_SESSION[&#039;filedtempc1&#039;])
{
if (md5($wsx) == $_SESSION[&#039;filedtempc2&#039;])
{
if (md5($edc) == $_SESSION[&#039;filedtempc3&#039;])
{
if (md5($rfv) == $_SESSION[&#039;filedtempc4&#039;])
{
if (md5($tgb) == $_SESSION[&#039;filedtempc5&#039;])
{
header(&quot;Expires: Mon, 26 Jul 1997 05:00:00 GMT&quot;);
header(&quot;Last-Modified: &quot; . gmdate(&quot;D, d M Y H:i:s&quot;) . &quot;GMT&quot;);
header(&quot;Cache-Control: no-cache, must-revalidate&quot;);
header(&quot;Pragma: no-cache&quot;);
header(&quot;Content-Disposition: attachment; filename=&quot;$filen&quot;&quot;);
header(&quot;Location: $subroot/$ofile?

pschk=$pschk&amp;tcode=$tcode&amp;qaz=$qaz&amp;wsx=$wsx&amp;edc=$edc&amp;rfv=$rf

v&amp;tgb=$tgb&amp;td=$td&quot;);
} else {
header(&quot;Location: error.php&quot;);
exit;
}
}
}
}
}
}

it alway open in the &quot;$ofile&quot; name but not in the &quot;$filen&quot; name? why?
</description>
		<content:encoded><![CDATA[<p>this my php file :<br />
session_start();<br />
$pschk = $_POST['pschk'];<br />
$subroot = $_POST['subroot'];<br />
$filen = $_POST['filen'];<br />
$ofile = $_POST['ofile'];<br />
$tcode = $_POST['tcode'];<br />
$qaz = $_POST['qaz'];<br />
$qaz = $_POST['qaz'];<br />
$wsx = $_POST['wsx'];<br />
$edc = $_POST['edc'];<br />
$rfv = $_POST['rfv'];<br />
$tgb = $_POST['tgb'];<br />
$dt = $_POST['dt'];<br />
if (md5($pschk) == $_SESSION['image_random_value'])<br />
{<br />
if (md5($qaz) == $_SESSION['filedtempc1'])<br />
{<br />
if (md5($wsx) == $_SESSION['filedtempc2'])<br />
{<br />
if (md5($edc) == $_SESSION['filedtempc3'])<br />
{<br />
if (md5($rfv) == $_SESSION['filedtempc4'])<br />
{<br />
if (md5($tgb) == $_SESSION['filedtempc5'])<br />
{<br />
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");<br />
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");<br />
header("Cache-Control: no-cache, must-revalidate");<br />
header("Pragma: no-cache");<br />
header("Content-Disposition: attachment; filename="$filen"");<br />
header("Location: $subroot/$ofile?</p>
<p>pschk=$pschk&#038;tcode=$tcode&#038;qaz=$qaz&#038;wsx=$wsx&#038;edc=$edc&#038;rfv=$rf</p>
<p>v&#038;tgb=$tgb&#038;td=$td");<br />
} else {<br />
header("Location: error.php");<br />
exit;<br />
}<br />
}<br />
}<br />
}<br />
}<br />
}</p>
<p>it alway open in the "$ofile" name but not in the "$filen" name? why?</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：PaulSo</title>
		<link>http://www.neo.com.tw/archives/322/comment-page-1#comment-1612</link>
		<dc:creator>PaulSo</dc:creator>
		<pubDate>Mon, 08 Jan 2007 20:53:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.neo.vomosa.com/blog/?p=322#comment-1612</guid>
		<description>加了
ob_start();
ob_flush();
還是有無法直接開啟的問題, 用了：
header(&quot;Cache-Control: cache, must-revalidate&quot;);
就可以了, thx
</description>
		<content:encoded><![CDATA[<p>加了<br />
ob_start();<br />
ob_flush();<br />
還是有無法直接開啟的問題, 用了：<br />
header("Cache-Control: cache, must-revalidate");<br />
就可以了, thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：andy</title>
		<link>http://www.neo.com.tw/archives/322/comment-page-1#comment-1611</link>
		<dc:creator>andy</dc:creator>
		<pubDate>Thu, 07 Dec 2006 23:11:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.neo.vomosa.com/blog/?p=322#comment-1611</guid>
		<description>我用的是asp.net
遇到相同的問題
卻無法用BufferOutput解決
有人解決過嗎
</description>
		<content:encoded><![CDATA[<p>我用的是asp.net<br />
遇到相同的問題<br />
卻無法用BufferOutput解決<br />
有人解決過嗎</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：sunnyman</title>
		<link>http://www.neo.com.tw/archives/322/comment-page-1#comment-1610</link>
		<dc:creator>sunnyman</dc:creator>
		<pubDate>Wed, 27 Sep 2006 22:53:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.neo.vomosa.com/blog/?p=322#comment-1610</guid>
		<description>加上了ob_start();

ob_flush();
还是错误！

</description>
		<content:encoded><![CDATA[<p>加上了ob_start();</p>
<p>ob_flush();<br />
还是错误！</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：Chue</title>
		<link>http://www.neo.com.tw/archives/322/comment-page-1#comment-1609</link>
		<dc:creator>Chue</dc:creator>
		<pubDate>Thu, 26 Jan 2006 19:25:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.neo.vomosa.com/blog/?p=322#comment-1609</guid>
		<description>感謝 Alex 的無私奉獻與指教, 的確使得!
</description>
		<content:encoded><![CDATA[<p>感謝 Alex 的無私奉獻與指教, 的確使得!</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：Neo</title>
		<link>http://www.neo.com.tw/archives/322/comment-page-1#comment-1608</link>
		<dc:creator>Neo</dc:creator>
		<pubDate>Mon, 16 Jan 2006 09:51:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.neo.vomosa.com/blog/?p=322#comment-1608</guid>
		<description>Alex:
謝謝你的補充喔!^^
</description>
		<content:encoded><![CDATA[<p>Alex:<br />
謝謝你的補充喔!^^</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：Alex</title>
		<link>http://www.neo.com.tw/archives/322/comment-page-1#comment-1607</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Tue, 10 Jan 2006 01:56:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.neo.vomosa.com/blog/?p=322#comment-1607</guid>
		<description>綜合各家所長, 我整理出來的 PHP 萬用下載 SCRIPT

//For IE 5.5 設定用
if(ini_get(&#039;zlib.output_compression&#039;))
ini_set(&#039;zlib.output_compression&#039;, &#039;Off&#039;);

header(&quot;Content-Type: application/octetstream; name=$FILEname&quot;);  //for IE &amp; Opera

header(&quot;Content-Type: application/octet-stream; name=$FILEname&quot;); //for the rest

header(&quot;Content-Disposition: attachment; filename=$FILEname;&quot;);

header(&quot;Content-Transfer-Encoding: binary&quot;);
header(&quot;Cache-Control: cache, must-revalidate&quot;);
header(&quot;Pragma: public&quot;);
header(&quot;Expires: 0&quot;);
</description>
		<content:encoded><![CDATA[<p>綜合各家所長, 我整理出來的 PHP 萬用下載 SCRIPT</p>
<p>//For IE 5.5 設定用<br />
if(ini_get('zlib.output_compression'))<br />
ini_set('zlib.output_compression', 'Off');</p>
<p>header("Content-Type: application/octetstream; name=$FILEname");  //for IE &#038; Opera</p>
<p>header("Content-Type: application/octet-stream; name=$FILEname"); //for the rest</p>
<p>header("Content-Disposition: attachment; filename=$FILEname;");</p>
<p>header("Content-Transfer-Encoding: binary");<br />
header("Cache-Control: cache, must-revalidate");<br />
header("Pragma: public");<br />
header("Expires: 0");</p>
]]></content:encoded>
	</item>
	<item>
		<title>由：xaxis</title>
		<link>http://www.neo.com.tw/archives/322/comment-page-1#comment-1606</link>
		<dc:creator>xaxis</dc:creator>
		<pubDate>Wed, 21 Dec 2005 20:56:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.neo.vomosa.com/blog/?p=322#comment-1606</guid>
		<description>打以下的header 移走
header(&quot;Pragma: no-cache&quot;);
header(&quot;Expires: 0&quot;);
</description>
		<content:encoded><![CDATA[<p>打以下的header 移走<br />
header("Pragma: no-cache");<br />
header("Expires: 0");</p>
]]></content:encoded>
	</item>
</channel>
</rss>

