public
|
__construct(
SplFileInfo|string $file,
int $status = 200,
array $headers = [],
bool $public = true,
string|null $contentDisposition = null,
bool $autoEtag = false,
bool $autoLastModified = true,
)
Parameters
| $file |
The file to stream
|
| $status |
The response status code (200 "OK" by default)
|
| $headers |
An array of response headers
|
| $public |
Files are public by default
|
| $contentDisposition |
The type of Content-Disposition to set automatically with the filename
|
| $autoEtag |
Whether the ETag header should be automatically set
|
| $autoLastModified |
Whether the Last-Modified header should be automatically set
|
Overrides
|
#
|
public
|
setContentDisposition(string $disposition, string $filename = '', string $filenameFallback = ''): $this
Sets the Content-Disposition header with the given filename.
Sets the Content-Disposition header with the given filename.
Parameters
| $disposition |
ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT
|
| $filename |
Optionally use this UTF-8 encoded filename instead of the real name of the file
|
| $filenameFallback |
A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename
|
|
#
|
public
|
sendContent(): static
Sends content for the current web response.
Sends content for the current web response.
Overrides
|
#
|
public
|
setContent(?string $content): static
Sets the response content.
Sets the response content.
Throws
Overrides
|
#
|
public
|
getContent(): string|false
Gets the current response content.
Gets the current response content.
Overrides
|
#
|
public
|
deleteFileAfterSend(bool $shouldDelete = true): $this
If this is set to true, the file will be unlinked after the request is sent
Note: If the X-Sendfile header is used, theā¦
If this is set to true, the file will be unlinked after the request is sent
Note: If the X-Sendfile header is used, the deleteFileAfterSend setting will not be used.
|
#
|