<i id='zBTln'><tr id='zBTln'><dt id='zBTln'><q id='zBTln'><span id='zBTln'><b id='zBTln'><form id='zBTln'><ins id='zBTln'></ins><ul id='zBTln'></ul><sub id='zBTln'></sub></form><legend id='zBTln'></legend><bdo id='zBTln'><pre id='zBTln'><center id='zBTln'></center></pre></bdo></b><th id='zBTln'></th></span></q></dt></tr></i><div id='zBTln'><tfoot id='zBTln'></tfoot><dl id='zBTln'><fieldset id='zBTln'></fieldset></dl></div>

      <small id='zBTln'></small><noframes id='zBTln'>

      <tfoot id='zBTln'></tfoot>
    1. <legend id='zBTln'><style id='zBTln'><dir id='zBTln'><q id='zBTln'></q></dir></style></legend>

      • <bdo id='zBTln'></bdo><ul id='zBTln'></ul>

      在 PHP 中显示 Active Directory 中的缩略图

      时间:2023-10-15
    2. <i id='RjuGI'><tr id='RjuGI'><dt id='RjuGI'><q id='RjuGI'><span id='RjuGI'><b id='RjuGI'><form id='RjuGI'><ins id='RjuGI'></ins><ul id='RjuGI'></ul><sub id='RjuGI'></sub></form><legend id='RjuGI'></legend><bdo id='RjuGI'><pre id='RjuGI'><center id='RjuGI'></center></pre></bdo></b><th id='RjuGI'></th></span></q></dt></tr></i><div id='RjuGI'><tfoot id='RjuGI'></tfoot><dl id='RjuGI'><fieldset id='RjuGI'></fieldset></dl></div>

        <legend id='RjuGI'><style id='RjuGI'><dir id='RjuGI'><q id='RjuGI'></q></dir></style></legend>

          <small id='RjuGI'></small><noframes id='RjuGI'>

            <bdo id='RjuGI'></bdo><ul id='RjuGI'></ul>

                  <tbody id='RjuGI'></tbody>

                <tfoot id='RjuGI'></tfoot>

              1. 本文介绍了在 PHP 中显示 Active Directory 中的缩略图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我已经设置了一个系统来显示 Active Directory 中每个人的姓名、电子邮件地址和电话号码,但是我无法使用thumbailPhoto".

                I've set up a system to display everyone's name, email address and phone number from Active Directory however I can't get the 'thumbailPhoto' to work.

                我在 Internet 上四处搜索,但找不到这是否可行,或者至少找不到从 Active Directory 返回的格式.

                I have searched around on the internet but haven't been able to find if this is possible or at the very least what format is returned from Active Directory.

                我目前正在使用 adldap 类,所以如果可以使用它,那将是理想的.

                I am currently using the adldap class so if it is possible to use this that would be ideal.

                提前致谢.

                我可以检索thumbnailPhoto属性中的数据,如果我将它们直接转储到浏览器,我会得到如下结果:

                I can retrieve the data in the thumbnailPhoto attribute and if I dump them straight to the browser I get something like this:

                àJFIFáPExifII*bh~(2iXCanonCanon EOS 5D MarkIII2013:05:19 17:35:31àè"' 0230'' ' ('0'8' ' '@''11''11 0100HP¤¤¤ 2013:04:1711:44:522013:04:17 11:44:52Ho@B èdnW:|(’HHàJFIFC $.'",#(7),01444'9=82<.342C2!!2222222222222222222222222222222222222222222222222–d"}!1AQa"q2'#B±R$3br%&'()456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz…‰'"–—~|§¨·w!1AQaq"2B'± #3Rbr $4á%&'()

                àJFIFá PExifII*bh~(2iXCanonCanon EOS 5D Mark III2013:05:19 17:35:31àè"' 0230’ ’ ’ (’0’8’ ’ ’@‘’11’’11 0100 HP¤¤¤¤ 2013:04:17 11:44:522013:04:17 11:44:52Ho@B èdnW:(’ HHàJFIFC $.' ",#(7),01444'9=82<.342C 2!!22222222222222222222222222222222222222222222222222–d" }!1AQa"q2‘#B±R$3br %&'()456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz…‰’""–—¤§¨·×áèéêòó÷ùú w!1AQaq"2B‘± #3Rbr $4á%&'()

                这不是全部,但它是一个很长的字符串,我假设是某种二进制字符串?

                That isn't all of it but it is a very long string, I am presuming is some sort of binary string?

                推荐答案

                这似乎是一个 JPEG 文件,因此您应该能够将该数据连同适当的 MIME 类型一起发送到浏览器.应该可以使用以下内容输出该图像:

                This seems to be a JPEG-File, so you should be able to send that data together with the appropriate mime-type to the browser. It should be possible to output that image with something like:

                <img src="data:image/jpeg;base64,<?php echo base64_encode($imageString); ?>"/>
                

                但也可以将任何图像格式的文件保存到该thumbnailPhoto属性中.因此,我会将内容放入一个临时文件中,然后直接从服务器提供.您需要通过 finfo 传递文件以获得正确的 MIME 类型.

                But it might also be possible to save files of any image format into that thumbnailPhoto attribute. Therefore, I would put the content into a temporary file that will then be served directly from the server. You will need to pass the file through finfo to get the correct mime-type.

                所以你可以这样做:

                $tempFile = tempnam(sys_get_temp_dir(), 'image');
                file_put_contents($tempFile, $imageString);
                $finfo = new finfo(FILEINFO_MIME_TYPE);
                $mime  = explode(';', $finfo->file($tempFile));
                echo '<img src="data:' . $mime[0] . ';base64,' . base64_encode($imageString) . '"/>';
                

                这篇关于在 PHP 中显示 Active Directory 中的缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:yii2:抛出新异常的正确方法 下一篇:在 Linux 机器上使用 PHP 将 Windows 时间戳转换为日期

                相关文章

                  <bdo id='38owv'></bdo><ul id='38owv'></ul>
                  <i id='38owv'><tr id='38owv'><dt id='38owv'><q id='38owv'><span id='38owv'><b id='38owv'><form id='38owv'><ins id='38owv'></ins><ul id='38owv'></ul><sub id='38owv'></sub></form><legend id='38owv'></legend><bdo id='38owv'><pre id='38owv'><center id='38owv'></center></pre></bdo></b><th id='38owv'></th></span></q></dt></tr></i><div id='38owv'><tfoot id='38owv'></tfoot><dl id='38owv'><fieldset id='38owv'></fieldset></dl></div>

                  <small id='38owv'></small><noframes id='38owv'>

                  <tfoot id='38owv'></tfoot>

                    <legend id='38owv'><style id='38owv'><dir id='38owv'><q id='38owv'></q></dir></style></legend>