Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
downloadresponse.php
1<?php
2
3namespace Bitrix\Mail\Helper;
4
10{
18 public function __construct(string $content, string $name = 'download_file', string $contentType = 'application/octet-stream')
19 {
20 parent::__construct();
21 $this->setContent($content);
22
23 $headers = new \Bitrix\Main\Web\HttpHeaders();
24 $headers->add('Pragma', 'public');
25 $headers->add('Expires', '0');
26 $headers->add('Cache-Control', 'must-revalidate, post-check=0, pre-check=0');
27 $headers->add('Content-Disposition', 'attachment; filename="' . $name . '";');
28 $headers->add('Content-Transfer-Encoding', 'binary');
29 $headers->add('Content-Length', strlen($content));
30 $headers->add('Content-Type', $contentType);
31
32 $this->setHeaders($headers);
33 }
34
35}
__construct(string $content, string $name='download_file', string $contentType='application/octet-stream')
setHeaders(Web\HttpHeaders $headers)
setContent($content)
Definition response.php:31