• Home
  • Demo
  • Buy Now
RISE - Ultimate Project Manager & CRM
    RISE - Ultimate Project Manager & CRMInstallation & MaintenancePersonalizationSettingsClient ManagementAI AssistantInvoices & PaymentsProjects & TasksTeam & CollaborationProductivity ToolsSales & ServicesRISE ReportsPluginsFAQChange logs
Mailbox PluginLanding Page Builder PluginEasy Backup PluginSquare Payment Method PluginLogin as Client PluginAsset Management Plugin2 Factor Authentication PluginPassword Manager PluginSocial Login PluginGoogle Meet Integration PluginSpreadsheets PluginZoom Integration PluginAuto Attendance PluginWhiteboards PluginDocs PluginBlog Manager PluginWhatsApp Link PluginMicrosoft Teams Integration PluginProperty Management PluginTelegram Notification PluginAWS S3 Integration PluginWhatsApp Notification PluginWasabi Integration PluginBackblaze Integration PluginCloudflare R2 Integration PluginDigitalOcean Spaces Integration PluginAdyen Payment Method PluginbKash Payment Method Pluginiyzico Payment Method PluginJazzCash Payment Method PluginMercado Pago Payment Method PluginMidtrans Payment Method PluginMontonio Payment Method PluginN-Genius Payment Method PluginNagad Payment Method PluginPayFast Payment Method PluginPaysera Payment Method PluginPaystack Payment Method PluginPix Payment Method PluginRazorpay Payment Method PluginRocket Payment Method PluginSSLCommerz Payment Method Plugin
  1. Docs
  2. RISE - Ultimate Project Manager & CRM
  3. Plugins

Work with files from a plugin

RISE has one common set of functions for files. Use them in your plugin whenever you save, show, read or delete a file. Then your plugin works with every storage: the local files folder, Google Drive, or a storage plugin.

How a file is saved

A saved file is a small array. Most modules keep a list of them in a files column (serialized).

KeyWhat it holds
file_nameThe stored file name, with a unique prefix.
file_sizeSize in bytes.
file_idThe file id on a remote storage. Empty for local files.
service_typeEmpty for local files, google for Google Drive, or the name of a storage plugin.

The folder is not saved in the array. You pass it to the functions, for example get_setting("timeline_file_path").

Functions to use

FunctionUse it to
move_files_from_temp_dir_to_permanent_dir($path, $related_to)Save the files of a Dropzone form. Returns the serialized files list.
move_temp_file($file_name, $path, $related_to)Save one uploaded file.
save_app_file_content($file_name, $content, $path, $related_to)Save a file from a content string.
get_source_url_of_file($file, $path, $view_type)Get the url of a file. Use "thumbnail" as view type for images.
get_file_preview_data($file, $path)Get the url and the preview options for a file preview modal.
get_app_file_content($file, $path)Read the content of a file. Returns false when it is not found.
delete_app_files($path, $files)Delete files.
is_google_drive_file($file)Check if a file is on Google Drive.
get_local_file_path($relative_path)Get the full server path of a local file or folder.
get_local_file_url($relative_path)Get the url of a local file, for files that are always local.

Please do not build file paths with getcwd() and do not build file urls with base_url(). These may change in the future, for example when files are kept in a separate folder for each site.

Example

//save the uploaded files
$files = move_files_from_temp_dir_to_permanent_dir(get_setting("timeline_file_path"), "my_plugin");

//show the first image
$files = unserialize($files);
$file = get_array_value($files, 0);
echo "";

//read the content
$content = get_app_file_content($file, get_setting("timeline_file_path"));

//delete the files
delete_app_files(get_setting("timeline_file_path"), $files);

Hooks for local files

These filters let a plugin change where local files are kept.

FilterWhat it changes
app_filter_local_file_pathThe full server path of a local file. You get the path and an array with relative_path.
app_filter_local_file_urlThe url of a local file. You get the url and an array with relative_path.
app_filter_convert_local_file_urls_to_pathsThe html of a PDF after the local file urls are changed to file paths.

Storage plugins still use the existing hooks: app_hook_upload_file_to_temp, app_filter_move_temp_file, app_filter_get_source_url_of_file, app_filter_get_file_content and app_hook_delete_app_file. Now app_filter_get_file_content is used everywhere RISE reads a file, not only for downloads.

Was this article helpful? Yes No
How can we improve this article?
© 2026 Fairsketch
Home Get Support Buy Now

Delete?

Are you sure? You won't be able to undo this action!
To do