1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
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
Определения
downloadresponse.php:10
Bitrix\Mail\Helper\DownloadResponse\__construct
__construct(string $content, string $name='download_file', string $contentType='application/octet-stream')
Определения
downloadresponse.php:18
Bitrix\Main\HttpResponse
Определения
httpresponse.php:8
Bitrix\Main\HttpResponse\$headers
$headers
Определения
httpresponse.php:14
Bitrix\Main\HttpResponse\setHeaders
setHeaders(Web\HttpHeaders $headers)
Определения
httpresponse.php:90
Bitrix\Main\Response\setContent
setContent($content)
Определения
response.php:31
Bitrix\Main\Response\$content
$content
Определения
response.php:7
$name
$name
Определения
menu_edit.php:35
$contentType
$contentType
Определения
quickway.php:301
bitrix
modules
mail
lib
helper
downloadresponse.php
Создано системой
1.14.0