utf 8 — PHP скачать файл UTF-8 BOM проблема

У меня есть скрипт, который вызывает загрузку PNG, но файл поврежден из-за UTF-8 BOM
Как удалить лишние байты в PHP без проверки каждого включенного PHP-файла (в PrestaShop)
Я попытался опустить буфер, но безуспешно

ob_start();
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="render_product_'.$id_product.'.png"');
header('Content-Transfer-Encoding: binary');
header('Connection: Keep-Alive');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: '.filesize($cache));
ob_end_clean();
readfile($cache);
exit();

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector