简体   繁体   English

任何人都可以帮助我使用 PHP 解决以下问题

[英]Can anyone help me to fix the following issues using PHP

  1. How to convert to images from blob data from database.如何从数据库中的 blob 数据转换为图像。

2.then that converted image should stored into the user specifying location in the local machine. 2.然后将转换后的图像存储到用户在本地机器中指定的位置。

Answer :回答 :

          $sql="select * from new_table where imageId='9'";
          $result=mysqli_Query($con,$sql);
          $row=mysqli_num_rows($result);
          while ($row = mysqli_fetch_Array($result))
              {
                  $image= $row['imageData'];
                  $decoded=base64_decode($image);
                  $name='File2.dwg';
              }
              file_put_contents($path."/".$name, $decoded);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM