后缀为下载类型
加上下面的代码也可以将认识的类型该为下载提示: Header( "Content-Type: application/x-".$Ream); 
Header( "Content-Length: ".filesize($FilePath)); //文件大小
Header( "Content-Disposition: attachment; filename=".$FileName);//文件名称

解决方案 »

  1.   

    如IE可以直接打开的就不弹出文件下载对话框,如html,txt格式等.
      

  2.   

    <a href="program/office.zip">office2000下载</a> 就可以实现了。
     还有一点就是这些文件要是能够下载的,象asp文件等一般是不能直接下载的,如果你要让别人去下载它们,你可以先打个包再下。
    另外看你要下载什么文件,如果是系统已知程序就会在IE中直接打开。例如.doc.
      

  3.   

    我用的用与下栽文件用的.
    <?
    //=============== program description ===============
    //
    //程序目的:下载文件
    //Written By LinShicheng. (email:[email protected])
    //
    //===================================================function get_ext_name($file){
    $part= explode('.',$file );
    $ext = $part[count($part) - 1];
    return ($ext);
    }
    function read_from_file ( $file ){
    if ( ! file_exists ( $file ) ){
    return ( FALSE );
    }
    $fp = fopen ( $file, "r" );
    if ( ! $fp ){
    return ( FALSE );
    }
    flock ( $fp, LOCK_SH );
    $data = fread ( $fp, filesize ( $file ) );
    fclose ( $fp );
    return ( $data );
    }
    if (!strstr($file,"upload")){
    echo "<script language='Javascript'>";
         echo "window.alert('出错啦,您非法访问!');";
           echo "window.close()";
           echo "</script>";
    exit;
    }
    if (strstr($file,"..")){
    echo "<script language='Javascript'>";
         echo "window.alert('出错啦,您非法访问!');";
           echo "window.close()";
           echo "</script>";
    exit;
    }
    $filename= basename($file);
    $ext = get_ext_name($filename);
    $mime_type=(USR_BROWSER_AGENT=='IE'||USR_BROWSER_AGENT=='OPERA')?'application/octetstream':'application/octet-stream';header ('Content-Type:'.$mime_type);
    $content_disp =(USR_BROWSER_AGENT =='IE')?'inline':'attachment';
    header ('Content-Disposition:'.$content_disp.';filename="'.$filename.'"');
    header ('Pragma: no-cache');
    header ('Expires: 0');
    $content =read_from_file($file);
    echo $content;
    ?>
      

  4.   

    我上面不是说了吗?不能下载的也可以发送header头搞成能下载的,呵呵
    没人看啊
      

  5.   

    用ftp下载,我猜只有这样才能够,php也有ftp的功能,可以尝试。