1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
bfile.php
См. документацию.
1<?php
2
3namespace Bitrix\Main\Engine\Response;
4
5
6use Bitrix\Main;
7
8class BFile extends File
9{
10 protected $file;
11
12 public function __construct(array $file, $name = null)
13 {
14 $this->file = $file;
15 if ($name === null)
16 {
17 $name = $this->file['ORIGINAL_NAME'];
18 }
19
20 parent::__construct(null, $name, $this->file['CONTENT_TYPE']);
21 }
22
23 public static function createByFileData(array $file, $name = null)
24 {
25 return new self($file, $name);
26 }
27
28 public static function createByFileId($fileId, $name = null)
29 {
30 $file = \CFile::getFileArray($fileId);
31 if (!$file)
32 {
33 throw new Main\ObjectNotFoundException("Could not find file ({$fileId})");
34 }
35
36 return new self($file, $name);
37 }
38
42 public function getFile()
43 {
44 return $this->file;
45 }
46
50 protected function prepareFile()
51 {
52 return $this->getFile();
53 }
54
55 protected function prepareOptions()
56 {
57 return [
58 'force_download' => !$this->isShowInline(),
59 'cache_time' => $this->getCacheTime(),
60 'attachment_name' => $this->getName(),
61 'content_type' => $this->getContentType(),
62 ];
63 }
64}
static createByFileData(array $file, $name=null)
Определения bfile.php:23
static createByFileId($fileId, $name=null)
Определения bfile.php:28
__construct(array $file, $name=null)
Определения bfile.php:12
getContentType()
Определения file.php:80
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Определения Image.php:9