Note that this method only prepares the response for file sending. The file is not sent
until Response::send is called explicitly or implicitly. The latter is done after you return from a controller action.
public sendContentAsFile ( string $content, string $attachmentName, array $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: - `mimeType`: the MIME type of the content. Defaults to 'application/octet-stream'. - `inline`: boolean, whether the browser should open the file within the browser window. Defaults to false, meaning a download dialog will pop up. |