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

    <tfoot id='ktKEl'></tfoot>
    1. <small id='ktKEl'></small><noframes id='ktKEl'>

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

      使用 PHP 将 Base64 字符串作为二进制文件保存到磁盘

      时间:2023-12-02

          <tbody id='yxb4B'></tbody>
          <bdo id='yxb4B'></bdo><ul id='yxb4B'></ul>

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

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

                本文介绍了使用 PHP 将 Base64 字符串作为二进制文件保存到磁盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                作为我自己的深入了解"教程,我正在构建一个 PHP 脚本来从 POP3 邮箱收集电子邮件.在尝试使用二进制附件时,我一直在试图弄清楚如何处理附件信息.

                As a "look under the covers" tutorial for myself I am building a PHP script to gather emails from a POP3 mailbox. While attempting to make use of binary attachments I am stuck trying to figure out what to do with the attachment information.

                给定一个将从电子邮件中收集的字符串:

                Given a string that would be gathered from an email:

                --------=_Part_16735_17392833.1229653992102内容类型:图片/jpeg;名称=trans2.jpg内容传输编码:base64X 附件 ID:f_fow87t5j0内容处置:附件;文件名=trans2.jpg

                ------=_Part_16735_17392833.1229653992102 Content-Type: image/jpeg; name=trans2.jpg Content-Transfer-Encoding: base64 X-Attachment-Id: f_fow87t5j0 Content-Disposition: attachment; filename=trans2.jpg

                /9j/4AAQSkZJRgABAgEASABIAAD/4QxrRXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEaAAAUAAAABAAAAYgEbAAUAAAABAAAAageEoAAMAAAABAAIAAAExAAIAAAAUAAAAcgEyAAIAAAAUAAAAhodp

                /9j/4AAQSkZJRgABAgEASABIAAD/4QxrRXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEaAAUA AAABAAAAYgEbAAUAAAABAAAAagEoAAMAAAABAAIAAAExAAIAAAAUAAAAcgEyAAIAAAAUAAAAhodp

                (...)

                EAgEAgEAgEAgEAg8IBQRL/Lbe/tJrScHqZ2lkmE4XUP2XcSDZZ2VvZ28dtbsDIYmhkbRxAIJCAQCAQCAQf/ScyAQCAQCAQCAQCAQCAQCAQCAQCAQCAQf/9k=------=_Part_16735_17392833.1229653992102--

                EAgEAgEAgEAgEAg8IBQRL/Lbe/tJrScHqZ2lkmE4XUP2XcSDZZ2VvZ28dtbsDIYmhkbRxAIJCAQC AQCAQf/ScyAQCAQCAQCAQCAQCAQCAQCAQCAQCAQf/9k= ------=_Part_16735_17392833.1229653992102--

                有没有办法将数据保存到磁盘,使其成为可用的格式?

                Is there a way to save off the data to disk so that it would be in a usable format?

                推荐答案

                将数据传递给 base64_decode() 到获取二进制数据,使用 file_put_contents()

                Pass the data to base64_decode() to get the binary data, write it out to a file with file_put_contents()

                这篇关于使用 PHP 将 Base64 字符串作为二进制文件保存到磁盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:Python 相当于 php 包 下一篇:PHP:如何将图像从 URL 转换为 Base64?

                相关文章

                    <small id='9quDu'></small><noframes id='9quDu'>

                    <legend id='9quDu'><style id='9quDu'><dir id='9quDu'><q id='9quDu'></q></dir></style></legend>
                    • <bdo id='9quDu'></bdo><ul id='9quDu'></ul>

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