/* A sample download.php to let user download file at server:
download.php?id=1 to download file doc/a.doc as 1.doc
download.php?id=2 to download file /abc.zip as 2.zip
*/
<?
if($id==1){
header("content-disposition: form-data; name=\"file\"; filename=\"1.doc\"");
readfile("doc/a.doc");
}else if($id==1){
header("content-disposition: form-data; name=\"file\"; filename=\"2.zip\"");
readfile("/abc.zip");/* the path format should be "c:\abc.zip" if under windows.*/
}else{
echo "invalid download id";
}