Arikaim CMS

FileDownload

File download and image view trait

Table of Contents

Methods

downloadFile()  : ResponseInterface
Download file
downloadFileHeaders()  : ResponseInterface
Download file
viewImage()  : ResponseInterface
View image
viewImageHeaders()  : ResponseInterface
View image headers

Methods

downloadFile()

Download file

public downloadFile(ResponseInterface $response, string $filePath[, string $filesystem = 'storage' ]) : ResponseInterface
Parameters
$response : ResponseInterface
$filePath : string
$filesystem : string = 'storage'
Return values
ResponseInterface

downloadFileHeaders()

Download file

public downloadFileHeaders(ResponseInterface $response, string $fileName, StreamInterface|string $stream) : ResponseInterface
Parameters
$response : ResponseInterface
$fileName : string
$stream : StreamInterface|string
Return values
ResponseInterface

viewImage()

View image

public viewImage(ResponseInterface $response, string $imagePath[, string|null $filesystem = 'storage' ][, string|null $mimeType = null ]) : ResponseInterface
Parameters
$response : ResponseInterface
$imagePath : string
$filesystem : string|null = 'storage'
$mimeType : string|null = null
Return values
ResponseInterface

viewImageHeaders()

View image headers

public viewImageHeaders(ResponseInterface $response, string $type, StreamInterface|string $stream) : ResponseInterface
Parameters
$response : ResponseInterface
$type : string

Content type

$stream : StreamInterface|string
Return values
ResponseInterface

        
On this page

Search results