Sets the file to stream.
SplFileInfo|string $file The file to stream:
string $contentDisposition:
Boolean $autoEtag:
Boolean $autoLastModified:
public function setFile($file, $contentDisposition = null, $autoEtag = false, $autoLastModified = true) {
$file = new File((string) $file);
if (!$file
->isReadable()) {
throw new FileException('File must be readable.');
}
$this->file = $file;
if ($autoEtag) {
$this
->setAutoEtag();
}
if ($autoLastModified) {
$this
->setAutoLastModified();
}
if ($contentDisposition) {
$this
->setContentDisposition($contentDisposition);
}
return $this;
}