那个弹出来的框跟php没多大关系,更多的是前端方面的,js或flex或其他

解决方案 »

  1.   


        好方法直接给个链接就好了 但事先要把图片放到服务器了。。  服务器路径怎么写的 我只会写本地的路径 比方说放到 yonghu文件夹里。。
    <?php    function get_file($url,$folder,$pic_name){ 
            set_time_limit(24*60*60); //限制最大的执行时间
            $destination_folder=$folder?$folder.'/':''; //文件下载保存目录
            $newfname=$destination_folder.$pic_name;//文件PATH
            $file=fopen($url,'rb');
             
            if($file){         
                $newf=fopen($newfname,'wb');
                if($newf){             
                    while(!feof($file)){                   
                        fwrite($newf,fread($file,1024*8),1024*8);
                    }
                }
                if($file){             
                    fclose($file);
                }
                if($newf){             
                    fclose($newf);
                }
            }      
        }  
     
    ?>   get_file($_POST[location],"D:\jieri","baidu.jpg");这个房本地的 放服务器怎么放?
      

  2.   

    我知道了 比方说http://csdnimg.cn/www/images/csdn_logo_blue.gif 这个图片 PHP怎么写 以下载的形式? 写成a href 也不行哈 打开也是一张图片哈。。
      

  3.   

    怎么不会搜索呢?
    http://www.google.com.hk/#newwindow=1&q=php+%E4%B8%8B%E8%BD%BD%E6%96%87%E4%BB%B6&safe=strict
      

  4.   

    那么多条搜索结果,copy下来试试不就知道了。
      

  5.   

    <?php
    //文件下载
    //readfile
    $filename="D:\jieri\baidu.jpg";
    $fileinfo = pathinfo($filename);
    header('Content-type: application/x-'.$fileinfo['extension']);
    header('Content-Disposition: attachment; filename='.$fileinfo['basename']);
    header('Content-Length: '.filesize($filename));
    readfile($thefile);
    exit();
    ?>
    这个代码确实是保存 但是保存下载的图片压根打不开哎 路径又没写错
      

  6.   

    readfile($filename); 路径分隔符用/
      

  7.   


    $filename="D:/jieri/baidu.jpg"; 还是不行 打不开
      

  8.   


    $filename="D:/jieri/baidu.jpg"; 还是不行 打不开 我用网络地址也打不开。。这个代码肯定有问题哈
      

  9.   

    <?php
    //文件下载
    //readfile
    $filename="http://csdnimg.cn/www/images/csdn_logo_blue.gif";
    $fileinfo = pathinfo($filename);
    header('Content-type: application/x-'.$fileinfo['extension']);
    header('Content-Disposition: attachment; filename='.$fileinfo['basename']);
    header('Content-Length: '.filesize($filename));
    readfile($thefile);
    exit();
    ?>打开
      

  10.   

    header("Content-type:text/html;charset=utf-8"); 
    if($file_name = @$_GET['file_name']){
    down($file_name);
    }
    function down($file_name){
    $file_name=iconv("utf-8","gb2312",$file_name);//中文上传
    $file_sub_path=$_SERVER['DOCUMENT_ROOT']."/file/"; 
    $file_path=$file_sub_path.$file_name;
    if(!file_exists($file_path)){ 
    echo "没有该文件文件"; 
    return ; 

    $fp=fopen($file_path,"r"); 
    $file_size=filesize($file_path); 
    //下载文件需要用到的头 
    Header("Content-type: application/octet-stream"); 
    Header("Accept-Ranges: bytes"); 
    Header("Accept-Length:".$file_size); 
    Header("Content-Disposition: attachment; filename=".$file_name); 
    $buffer=1024; 
    $file_count=0; 
    //向浏览器返回数据 
    while(!feof($fp) && $file_count<$file_size){ 
    $file_con=fread($fp,$buffer); 
    $file_count+=$buffer; 
    echo $file_con; 

    fclose($fp);
    }
    ?>
    <input type="button" value="下载" onclick="location.href='dd.php?file_name=qq.png'"/>
      

  11.   

    我晕我只要写  已知http://www.cn.tesco.com/images2013/logo.jpg 图片 怎么下载<?php
    //文件下载
    //readfile
    $filename="http://csdnimg.cn/www/images/csdn_logo_blue.gif";
    $fileinfo = pathinfo($filename);
    header('Content-type: application/x-'.$fileinfo['extension']);
    header('Content-Disposition: attachment; filename='.$fileinfo['basename']);
    header('Content-Length: '.filesize($filename));
    readfile($thefile);
    exit();
    ?>这个代码根本就不行
      

  12.   

    我晕我只要写  已知http://www.cn.tesco.com/images2013/logo.jpg 图片 怎么下载<?php
    //文件下载
    //readfile
    $filename="http://csdnimg.cn/www/images/csdn_logo_blue.gif";
    $fileinfo = pathinfo($filename);
    header('Content-type: application/x-'.$fileinfo['extension']);
    header('Content-Disposition: attachment; filename='.$fileinfo['basename']);
    header('Content-Length: '.filesize($filename));
    readfile($thefile);
    exit();
    ?>这个代码根本就不行http://www.oschina.net/code/snippet_272777_21247
      

  13.   

    刚刚发现的代码,不过没有另存为框<?php
    copy("http://www.cn.tesco.com/images2013/logo.jpg", "./dd.jpg");
    $size = round((filesize('./dd.jpg')/1000000), 3);
    ?>
      

  14.   

    亲,我又来了
    又带来一个方法...
    <?php
    header("content-type:text/html;charset=utf-8");
    $url = @$_GET['url'];
    $file_name = 'test.jpg';
    if($url){
    $file = @fopen($url,"r");
    header("content-type: application/octet-stream");
    header("content-disposition: attachment; filename=".$file_name);
    while (!feof ($file)) {//测试文件指针是否到了文件结束的位置
    echo fread($file,50000);
    }
    fclose ($file);
    }
    ?>
    <input type="button" value="保存" onclick="location.href='cc.php?url=http://www.cn.tesco.com/images2013/logo.jpg'" />
    我怎么有种自娱自乐的感觉