ResponseDownload
Trait ResponseDownload.
Tags
Table of Contents
- $request : Request
- hasDownload() : bool
- Tell if Response has a downloadable file.
- setDownload() : static
- Sets a file to download/stream.
- sendDownload() : void
Properties
$request
public
Request
$request
Methods
hasDownload()
Tell if Response has a downloadable file.
public
hasDownload() : bool
Return values
bool —setDownload()
Sets a file to download/stream.
public
setDownload(string $filepath[, bool $inline = false ][, bool $acceptRanges = true ], int $delay[, int $readLength = 1024 ][, string|null $filename = null ]) : static
Parameters
- $filepath : string
- $inline : bool = false
-
Set Content-Disposition header as "inline". Browsers load the file in the window. Set true to allow video or audio streams
- $acceptRanges : bool = true
-
Set Accept-Ranges header to "bytes". Allow partial downloads, media players to move the time position forward and back and download managers to continue/download multi-parts
- $delay : int
-
Delay between flushs in microseconds
- $readLength : int = 1024
-
Bytes read by flush
- $filename : string|null = null
-
A custom filename
Tags
Return values
static —sendDownload()
protected
sendDownload() : void