PHP 強制下載檔案, 而不讓程式開啟

| | Comments (0)

header("Content-type:application");
header("Content-Disposition: attachment; filename=file_name");
//file_name是預設下載時的檔名,可使用變數。
readfile("file");
//file是實際存放在你硬碟中要被下載的檔案,可使用變數。
exit(0);

ref.
http://dob.tnc.edu.tw/themes/old/showPage.php?s=3221&t=1

Leave a comment

March 2009

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

About this Entry

This page contains a single entry by Pank published on June 16, 2004 10:22 AM.

GNOME 取消視窗動畫 was the previous entry in this blog.

My Desktop is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.