# School File Management deployment

This feature uses a dedicated `school_files.php` API and eight independent PostgreSQL schemas (`school_files_agriculture`, `school_files_business`, `school_files_education`, `school_files_ict`, `school_files_health_sciences`, `school_files_engineering`, `school_files_natural_sciences`, and `school_files_tourism_hospitality`). It does not read or write the global File Management tables. Uploaded bytes live under `uploads/school_files/<workspace>/`, separately from `uploads/staff_files/`.

1. Upload `school_files.php`, `school_files_common.php`, `school_files_policy.php`, and `school_files_folders.php` to the backend `api/` directory.
2. Run `school_files_schema.sql` once against the same PostgreSQL database used by the application. The script creates all school schemas, file/version/upload/audit tables, and folder/sharing tables.
3. Ensure the PHP process can create and write to the backend `uploads/` directory. The API creates a protected school/workspace subdirectory on first use.
4. Upload the frontend `lib/` source bundle. School API access uses the same school module permission as the corresponding school in the left navigation.

The school manager retains the major File Management workflow: folders and invitations, uploads with resumable chunks, replacement versions, downloads, deletion, audit records, offline cache, and access checks. School workspace and user permission are derived/validated server-side; workspace keys are allow-listed.
