Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
downloadresponse.php
1
<?php
2
3
namespace
Bitrix\Mail\Helper
;
4
9
class
DownloadResponse
extends
\Bitrix\Main\HttpResponse
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
}
Bitrix\Mail\Helper\DownloadResponse
Definition
downloadresponse.php:10
Bitrix\Mail\Helper\DownloadResponse\__construct
__construct(string $content, string $name='download_file', string $contentType='application/octet-stream')
Definition
downloadresponse.php:18
Bitrix\Main\HttpResponse
Definition
httpresponse.php:8
Bitrix\Main\HttpResponse\$headers
$headers
Definition
httpresponse.php:14
Bitrix\Main\HttpResponse\setHeaders
setHeaders(Web\HttpHeaders $headers)
Definition
httpresponse.php:90
Bitrix\Main\Response\setContent
setContent($content)
Definition
response.php:31
Bitrix\Main\Response\$content
$content
Definition
response.php:7
Bitrix\Mail\Helper
modules
mail
lib
helper
downloadresponse.php
Создано системой
1.10.0