up没试过,但据编程经验,二进制有两种处理:
1、是流,用流对象
2、就是用字节函数或数组,只要读取的是字节(不是字符),就是二进制!下载也下载字节就可以了,程序会自动解码!
你查查PHP有没有字节变量或数组或函数

解决方案 »

  1.   

    <?php
            ob_end_clean();
            header('Cache-control: max-age=31536000');
            header('Expires: '.gmdate('D, d M Y H:i:s', $timestamp + 31536000).' GMT');
            header('Content-Encoding: none');
            $attach['filename'] = (strtolower($charset) == 'utf-8' && strexists($_SERVER['HTTP_USER_AGENT'], 'MSIE')) ? urlencode($attach['filename']) : $attach['filename'];        if($isimage && !empty($noupdate)) {
                    header('Content-Disposition: inline; filename='.$attach['filename']);
            } else {
                    header('Content-Disposition: attachment; filename='.$attach['filename']);
            }
            header('Content-Type: '.$attach['filetype']);        @$fp = fopen($filename, 'rb');
            @flock($fp, 2);
            $attachment = @fread($fp, $filesize);
            @fclose($fp);        echo $attachment;
    ?>dz中处理附件的方式,不是很好.但可以拿来参考.
    主要看怎么输出适当的文件头.
      

  2.   


    <?php
    header("Content-type: application/pdf"); #mime
    header("Content-Length: $len"); 
    header("Content-Disposition: inline; filename=hello.pdf");
    print $buf;
    ?>
    手册里的范例……
    没事多看看手册.
      

  3.   

    http://www.qqgb.com/NetProgramme/PHP/PHPdatabase/NetProgramme_117310.html
      

  4.   

    以文本二进制打开,存入数据库,下载,只是改成下载头,然后把数据库里面的信息取出来用echo 输出就可以了。