S
S
smoln2018-11-23 12:41:04
PHP
smoln, 2018-11-23 12:41:04

Why doesn't the imap_base64 function work?

Good afternoon, I am uploading attached exel files from the mail, they all load well, except for one, here is the processing code

$attach = imap_fetchbody($inbox, $email_number, 2);
print $attach;
$attach = imap_base64($attach);

after imap_base64 processing, an empty file is written, if we exclude this function, then the encoding is written to the file, here is its upper part.
Content-Type: application/octet-stream; name="application/vnd.ms-excel"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="=?utf-8?B?0J/RgNCw0LnRgSDQu9C40YHRgiDQtNC70Y8g0LrQu9C40LXQvdGC0L7Qsi54bHM=?="
Content-ID: <f550e486-508a-4415-8602-7e5f81c3bc24>
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAADFAAAACmIA
AAAAAAAAEAAA/v///wAAAABEYQAAAQAAAEVhAABGYQAAR2EAAEhhAABJYQAASmEAAEth
AABMYQAATWEAAE5hAABPYQAAUGEAAFFhAABSYQAAU2EAAFRhAABVYQAAVmEAAFdhAABY
YQAAWWEAAFphAABbYQAAXGEAAF1hAABeYQAAX2EAAGBhAABhYQAAYmEAAGNhAABkYQAA
ZWEAAGZhAABnYQAAaGEAAGlhAABqYQAAa2EAAGxhAABtYQAAbmEAAG9hAABwYQAAcWEA
AHJhAABzYQAAdGEAAHVhAAB2YQAAd2EAAHhhAAB5YQAAemEAAHthAAB8YQAAfWEAAH5h
AAB/YQAAgGEAAIFhAACCYQAAg2EAAIRhAACFYQAAhmEAAIdhAACIYQAAiWEAAIphAACL

how can i find the error? Or can anyone suggest a way to solve this issue?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question