如题~

解决方案 »

  1.   

     function fileDown($strFilePath, $strFileName, $strMimeType)
     {
    //check to exist the file
    if(file_exists($strFilePath) == false) return false;
    $fpFile = fopen($strFilePath, "r");
    if($fpFile == false) return false;

    if($strFileName != null) {
    $nFileSize  = filesize($strFilePath);
    if(is_null($strMimeType) == true || $strMimeType == "") $strMimeType = "application/octet-stream";
    if(is_null($strMimeType) == true || $strMimeType == "") $strMimeType = "application/unknown";

    Header("Content-Type: ". $strMimeType .";");
    Header("Content-Disposition: attachment; filename=\"$strFileName\"");
    Header("Content-Length: $nFileSize");
    Header('Accept-Ranges: bytes');
    Header("Cache-control: private");
    Header('Pragma: private');
    Header("Expires: 0");
    }
    fpassthru($fpFile);
    return true;
      }
    }
      

  2.   

    路径直接指向文件名
    或者
    header()
    echo file_get_contents()
      

  3.   

    copy 即可
                   
                   
                
    --------------完美的签名线-----------------
    网页游戏开发第一站 http://dev.web863.com