3namespace Bitrix\UI\FileUploader;
5use Bitrix\Main\Localization\Loc;
7Loc::loadLanguageFile(__DIR__ .
'/UserErrors.php');
57 private static array $systemErrors = [
58 self::INVALID_CONTENT_RANGE =>
'Content-Range header is invalid',
59 self::INVALID_CONTENT_TYPE =>
'Content-Type header is required.',
60 self::INVALID_CONTENT_LENGTH =>
'Content-Length header is required.',
61 self::INVALID_CONTENT_NAME =>
'X-Upload-Content-Name header is required.',
62 self::INVALID_FILENAME =>
'Filename is invalid.',
63 self::INVALID_RANGE_SIZE =>
'Range chunk file size (#rangeChunkSize#) is not equal Content-Length (#contentLength#).',
64 self::INVALID_CHUNK_SIZE =>
'Chunk file size (#chunkSize#) is not equal Content-Length (#contentLength#).',
65 self::INVALID_CHUNK_OFFSET =>
'Chunk offset is invalid.',
66 self::TOO_BIG_REQUEST =>
'The content length is too big to process the request.',
67 self::FILE_FIND_FAILED =>
'Could not find a file.',
68 self::FILE_MOVE_FAILED =>
'Could not move file.',
69 self::FILE_APPEND_NOT_FOUND =>
'File not found.',
70 self::CHUNK_NOT_FOUND =>
'Could not find chunk file.',
71 self::CHUNK_COPY_FAILED =>
'Could not copy chunk file.',
72 self::CHUNK_TOO_BIG =>
'You cannot upload a chunk more than the file size.',
73 self::CHUNK_APPEND_NOT_FOUND =>
'Could not find chunk.',
74 self::CHUNK_APPEND_FAILED =>
'Could not put contents to file.',
75 self::CLOUD_EMPTY_BUCKET =>
'Could not get the cloud bucket.',
76 self::CLOUD_INVALID_CHUNK_SIZE =>
'Cannot upload file to cloud. The size of the chunk (#chunkSize#) must be more than #minUploadSize#. Check "post_max_size" (#postMaxSize#) and "upload_max_filesize" (#uploadMaxFileSize#) options in php.ini.',
77 self::CLOUD_GET_CONTENTS_FAILED =>
'Could not get file contents.',
78 self::CLOUD_START_UPLOAD_FAILED =>
'Could not start cloud upload.',
79 self::CLOUD_FINISH_UPLOAD_FAILED =>
'Could not finish cloud upload.',
80 self::CLOUD_UPLOAD_FAILED =>
'Could not upload file for #fails# times.',
81 self::EMPTY_TOKEN =>
'Could not append content to file. Have to set token parameter.',
82 self::UNKNOWN_TOKEN =>
'Could not find file by token.',
83 self::INVALID_SIGNATURE =>
'Token signature is invalid.',
88 $message = isset($args[0]) && is_string($args[0]) ? $args[0] :
null;
89 $description = isset($args[1]) && is_string($args[1]) ? $args[1] :
null;
90 $lastIndex =
count($args) - 1;
91 $customData = isset($args[$lastIndex]) && is_array($args[$lastIndex]) ? $args[$lastIndex] : [];
96 $replacements[
"#{$key}#"] = $value;
99 if (isset(self::$systemErrors[
$code]))
102 foreach ($replacements as $search => $repl)
113 $message = Loc::getMessage(
"UPLOADER_{$code}", $replacements);
118 $description = Loc::getMessage(
"UPLOADER_{$code}_DESC", $replacements);
159 'type' =>
'file-uploader',
const CHUNK_APPEND_FAILED
const FILE_NAME_NOT_ALLOWED
const FILE_UPLOAD_ACCESS_DENIED
const MAX_FILE_SIZE_EXCEEDED
const CLOUD_UPLOAD_FAILED
const FILE_APPEND_NOT_FOUND
const IMAGE_MAX_FILE_SIZE_EXCEEDED
setDescription(string $description)
const CLOUD_INVALID_CHUNK_SIZE
const IMAGE_MIN_FILE_SIZE_EXCEEDED
const INVALID_CONTENT_TYPE
const INVALID_CONTENT_NAME
__construct(string $code,... $args)
const CLOUD_FINISH_UPLOAD_FAILED
const INVALID_CHUNK_OFFSET
const FILE_REMOVE_ACCESS_DENIED
const FILE_LOAD_ACCESS_DENIED
const FILE_TYPE_NOT_ALLOWED
const CLOUD_START_UPLOAD_FAILED
const INVALID_CONTENT_RANGE
const MIN_FILE_SIZE_EXCEEDED
const IMAGE_TYPE_NOT_SUPPORTED
const CLOUD_GET_CONTENTS_FAILED
const INVALID_CONTENT_LENGTH
const CHUNK_APPEND_NOT_FOUND
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"