二进制流上传图片

来源:互联网 发布:数据恢复网站 编辑:程序博客网 时间:2024/06/06 18:21

思路:

        1.写入字符串

         2.编码

         3.传值

         4.接值转码(对比图片内容)

          5.写入文件


    <?php      header("content-type:text/html;charset=utf-8");      $str=file_get_contents("./img/1.png");      $count=base64_encode($str);      //echo $count;      $a=date('Y-m-d');      $d=strtotime($a);      echo $d;      ?>      <a href='uplsel.php?count=<?php echo $count?>'>跳</a>  

    <?php      header("content-type:text/html;charset=utf-8");       $count=$_GET['count'];      $arr=str_replace(' ','+',$count);      $str=base64_decode($arr);      file_put_contents('./img/2.png',$str);      ?>  


0 0