如果不是类似一般的下载方式(点开,询问客户端是否保存)的话~~想在后台自己完成应该是不可能的~~php这样的服务器端脚本怎么去完成在客户端的文件级写操作~~

解决方案 »

  1.   

    /* 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";
    }