sendContentAsFile() public method
Sends the specified content as a file to the browser.
Note that this method only prepares the response for file sending. The file is not sent until send() is called explicitly or implicitly. The latter is done after you return from a controller action.
See also sendFile() for an example implementation.
public $this sendContentAsFile ( $content, $attachmentName, $options = [] ) | ||
---|---|---|
$content | string |
The content to be sent. The existing $content will be discarded. |
$attachmentName | string |
The file name shown to the user. |
$options | array |
Additional options for sending the file. The following options are supported:
|
return | $this |
The response object itself |
throws | yii\web\HttpException |
if the requested range is not satisfiable |
Please login to continue.