• <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 字符串作为二进制文件保存到磁盘

      Saving a Base64 string to disk as a binary using PHP(使用 PHP 将 Base64 字符串作为二进制文件保存到磁盘)

          <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 字符串作为二进制文件保存到磁盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

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

                    <legend id='9quDu'><style id='9quDu'><dir id='9quDu'><q id='9quDu'></q></dir></style></legend>
                      <tbody id='9quDu'></tbody>
                      • <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>