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
ResponseInterfacedownloadFileHeaders()
Download file
public
downloadFileHeaders(ResponseInterface $response, string $fileName, StreamInterface|string $stream) : ResponseInterface
Parameters
- $response : ResponseInterface
- $fileName : string
- $stream : StreamInterface|string
Return values
ResponseInterfaceviewImage()
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
ResponseInterfaceviewImageHeaders()
View image headers
public
viewImageHeaders(ResponseInterface $response, string $type, StreamInterface|string $stream) : ResponseInterface
Parameters
- $response : ResponseInterface
- $type : string
-
Content type
- $stream : StreamInterface|string