经典论坛's Archiver

moosasa 发表于 2008-7-3 15:18

如何讓下載變成是另存檔案?

如何讓一個連接,好比連接到GIF或是JPG、PDF等,變成是存檔的對話框,而不是直接開啟?
想這裡這樣:[url]http://newwww.itri.org.tw/declaration/detail.asp?RootNodeId=060&NodeId=064&NewsID=239[/url]
請高手幫忙!

xling 发表于 2008-7-3 15:50

<?php
header ("Content-type: octet/stream");
header("Content-Disposition: filename=lan.zip");
echo file_get_contents("lan.zip");
?>

kuhanzhu 发表于 2008-7-3 15:53

ASP也是使用流进行推送。

moosasa 发表于 2008-7-3 20:33

有完整的範例供參考嗎?感謝了!

carmen1003 发表于 2008-7-4 08:30

2楼已经写了示例了啊,就是用header

页: [1]



Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.