web\Response setDownloadHeaders()

setDownloadHeaders() public method

Sets a default set of HTTP headers for file downloading purpose.

public $this setDownloadHeaders ( $attachmentName, $mimeType = null, $inline = false, $contentLength = null )
$attachmentName string

The attachment file name

$mimeType string

The MIME type for the response. If null, Content-Type header will NOT be set.

$inline boolean

Whether the browser should open the file within the browser window. Defaults to false, meaning a download dialog will pop up.

$contentLength integer

The byte length of the file being downloaded. If null, Content-Length header will NOT be set.

return $this

The response object itself

doc_Yii
2016-10-30 17:16:25
Comments
Leave a Comment

Please login to continue.