Seditio Source
Root |
./othercms/xenForo 2.2.8/src/XF/Admin/View/Attachment/View.php
<?php

namespace XF\Admin\View\Attachment;

class
View extends \XF\Mvc\View
{
    public function
renderRaw()
    {
       
/** @var \XF\Entity\Attachment $attachment */
       
$attachment = $this->params['attachment'];

        if (!empty(
$this->params['return304']))
        {
           
$this->response
               
->httpCode(304)
                ->
removeHeader('last-modified');

            return
'';
        }

       
$this->response
           
->setAttachmentFileParams($attachment->filename, $attachment->extension)
            ->
header('ETag', '"' . $attachment->attach_date . '"');

       
$resource = \XF::fs()->readStream($attachment->Data->getAbstractedDataPath());
        return
$this->response->responseStream($resource, $attachment->file_size);
    }
}