concrete/src/Entity/File/Version.php
public function buildForceDownloadResponse()
    {
        $fre = $this->getFileResource();

        $fs = $this->getFile()->getFileStorageLocationObject()->getFileSystemObject();
        $response = new FlysystemFileResponse($fre->getPath(), $fs);

        $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT);

        return $response;
    }
public function buildForceDownloadResponse()
    {
        $fre = $this->getFileResource();

        $fs = $this->getFile()->getFileStorageLocationObject()->getFileSystemObject();
        $response = new FlysystemFileResponse($fre->getPath(), $fs);

        $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT);

        return $response;
    }
public function buildForceDownloadResponse ( ) { $ fre = $ this -> getFileResource ( ) ; $ fs = $ this -> getFile ( ) -> getFileStorageLocationObject ( ) -> getFileSystemObject ( ) ; $ response = new FlysystemFileResponse ( $ fre -> getPath ( ) , $ fs ) ; $ response -> setContentDisposition ( ResponseHeaderBag :: DISPOSITION_ATTACHMENT ) ; return $ response ; }
Get a Response instance that will force the browser to download the file, even if the browser can display it.

@return \Concrete\Core\Http\Response
Get a Response instance that will force the browser to download the file even if the browser can display it .