By Niklas Fiekas on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
Symfony has a Symfony\Component\HttpFoundation\BinaryFileResponse class that can be used to deliver files through PHP to the client. It also supports X-Sendfile and X-Accel-Mapping via BinaryFileResponse::trustXSendfileTypeHeader().
file_transfer() has been dropped in favor of that.
Drupal 7:
return file_transfer($uri, $headers);
Drupal 8:
use Symfony\Component\HttpFoundation\BinaryFileResponse;
...
return new BinaryFileResponse($uri, 200, $headers);
Ref: http://symfony.com/doc/current/components/http_foundation/introduction.h...
Impacts:
Module developers