2
I have a code that takes binary files and converts them into Base64, but there are very large files and this ends up using much of the machine’s memory (and even process). To read large files generally (without converting them) I do this:
$handle = fopen('ARQUIVO', 'rb');
while (false === feof($handle)) {
$data = fgets($handle);
...
}
fclose($handle);
So I avoid exceeding memory and other such problems. But the problem is that with base64_encode
i need complete data (a string
entire).
How to encode large binary files without losing performance?
Yes. Behold: But its pieces have to be in multiple sizes of 3 in a matter of bytes.
– Alex M.