supportedOptions['attachmentCharset'] = [ 'utf-8', 'Charset of the content or FALSE if you want to suppress the information in header', 'string|false', ]; $this->supportedOptions['attachmentDisposition'] = [ 'attachment', 'One of "inline" or "attachment"', 'string', ]; } else { throw new \RuntimeException('supported option could not be set', 1697552694); } } public function render(): ResponseInterface { if ($this->options['attachmentCharset'] === false) { $charset = ''; } else { $charset = '; charset=' . $this->options['attachmentCharset']; } return new Response( 200, [ 'Content-Disposition' => ContentDisposition::create( $this->getAttachmentName(), true, $this->options['attachmentDisposition'] )->format(), 'Content-Type' => $this->getAttachmentMimeType() . $charset, ], $this->getAttachmentContent() ); } }