176 $fileContent = File::getFileContents($fileInfo[
"tmp_name"]);
179 $type = (in_array($fileInfo[
"type"], $this->zipMimeType)) ?
'ZIP' :
'TAR.GZ';
181 $filePath = $folder.
'archive_tmp';
183 File::putFileContents($filePath, $fileContent);
184 $archive = \CBXArchive::GetArchive($filePath, $type);
185 $res = $archive->Unpack($folder);
188 $this->initUnpackFilesList();
191 File::deleteFile($filePath);
310 if (Loader::includeModule(
'disk'))
314 $storage = Driver::getInstance()->addStorageIfNotExist(
319 $folder = $storage->getChild(
326 $file = $folder->getChild(
331 if ($file && $file->getFileId() > 0)
334 $documentRoot = $server->getDocumentRoot();
335 $filePath = $documentRoot . CFile::GetPath($file->getFileId());
336 if (File::isFileExists($filePath))
338 $content = File::getFileContents($filePath);
339 $fileList = Json::decode($content);
342 $subFolder = $folder->getChild(
349 $fileList = array_column($fileList,
null,
'ID');
350 $fakeSecurityContext = Driver::getInstance()->getFakeSecurityContext();
351 $folderFiles = $subFolder->getChildren(
352 $fakeSecurityContext,
355 '=TYPE' => ObjectTable::TYPE_FILE
360 foreach ($folderFiles as $file)
362 $id = $file->getOriginalName();
363 if (!empty($fileList[$id]))
365 $path = $documentRoot . CFile::GetPath(
368 if (File::isFileExists($path))
370 $saveFile = $fileList[$id];
371 $saveFile[
'PATH'] = $path;
372 $this->setting->set(self::CODE_UNPACK_FILE_PREFIX . $file->getFileId(), $saveFile);
385 catch (\Exception $e)