Demand Files
Demand Files is Rapid App's solution to uploading and downloading files. All apps that either handle uploaded files or downloading files should use it allow Rapid Apps to ensure files do not go missing or become untracked. Demand Files builds on top of Demand DB, and uses it to track all stored files.
To use Demand Files, ensure that /backend/database/demand-files.php is included in the script.
Initialising Demand Files
Before using Demand Files, it must first be initialised.
$fileController = new DemandFiles();
Uploading a single file
Frontend
Use a FormData() object and attach the file to it from a form input.
Backend
// Get the file from the files object
$file = $_FILES["file"];
// Initialise the file controller
$fileController = new DemandFiles();
// Uploads the file
$fileID = $fileController->upload_file($file);