This is an old revision of the document!


Starting with version 600.0801 I implement a temporarily filestore, which could used by the actions to store files for later usage, without make use of the VtigerCRM integrated Documents/Attachments and waste a CRMID for a file, you need for only one task.

The filestore is stored in an Environmental Variable or current execution. This means, all files of one execution will be removed, after the complete workflow is finished.

The filestore works like a key-value storage. Every file will have a FileStore ID, which must used to reference the file. For example one action will create a file and store this in the filestore with the ID “file_xyz”.

Every task in the same execution, which support filestore Input, could open the file with the ID “file_xyz”.

Разработчикам

Если вы хотите использовать хранилище файлов в собственных Задачах, используйте следующий интерфейс класса \Workflow\VTEntity, доступный через переменную $context.

Чтобы сохранить файл в хранилище файлов:

$context->addTempFile($filepath, $filestoreid, $filename);

Параметр

$filepath Строка Временный путь к файлу, который вы хотите поместить в хранилище. Этот файл будет перемещен в главную директорию временных файлов Дизайнера Бизнес-Процессов
$filestoreid Строка ID, который вы хотите использовать для идентификации файла
$filename Строка Имя файла

Для того, чтобы загрузить файл из хранилища файлов:

$file = $context->getTempFiles($filestoreid);

Параметр

$filestoreid Строка ID файла, который вы хотите загрузить

Возвращает

array(
   "path" => <абсолютный путь к файлу>,
   "name" => <название файла, которое вы задали в функции addTempFile()>
)
Enter your comment. Wiki syntax is allowed:
  _____   ____   ____  _   __   __  ___
 / ___/  / __/  / __/ | | / /  /  |/  /
/ /__   _\ \   / _/   | |/ /  / /|_/ / 
\___/  /___/  /___/   |___/  /_/  /_/