CASE FILES PROFESSIONAL — READABLE UPLOADS AND DELETE CONTROLS
For GIB and Commercial v1.0.0 baselines, including the custom Dropbox folder setting.

EXISTING INSTALLATION
Back up the application files and database. Extract the patch in the installed
application folder (where cases.php is located), allowing replacement of the
included files. It adds upload-delete.php and app/uploads.php. The Uploads listing is retired.
It does not replace installed.php, credentials, database contents or uploaded bytes.
No deletion or relocation occurs simply by installing the patch.

STORAGE
New server uploads keep the actual filename/extension inside a private unique
upload directory. New Dropbox uploads use a readable name, a unique suffix and
the original extension. Files contain actual document/image/video bytes; they
are not shortcuts. Normalized personnel/branding pictures retain the existing
image conversion behavior and use the corresponding JPEG/PNG extension.
Existing opaque storage paths remain readable and are not automatically renamed.
A folder and filename exceeding the stored remote-path limit causes cloud sync to
remain pending locally; use a shorter Dropbox folder/filename in that situation.

DROPBOX FOLDER
With App Folder access for Global Cases, /Test means
Dropbox/Apps/Global Cases/Test/documents.
/Apps/Test means Dropbox/Apps/Global Cases/Apps/Test/documents.
To address Dropbox/Apps/Test directly, authorize an app with Full Dropbox access.
The folder setting cannot expand the app's Dropbox permissions.

DELETE CONTROLS
Delete Upload links appear on case documents, subject/personnel photos, report
photos/supporting documents, videos and editable receipts, plus agency documents.
The Uploads tab and Case Cloud > Manage All Uploads list stored attachments across
the authorized scope, including branding images and unattached uploads.
A confirmation page names the file before a POST/CSRF-protected deletion.
Deletion removes the Dropbox/server bytes and editable references, revokes video
links and retains audit/file metadata. If cleanup fails, the upload is marked
for deletion, blocked from downloads and remains visible for retry in Uploads.
Reconnect the original Dropbox account when deleting a cloud-backed file.
Existing closed-case, evidence custody and submitted/approved report/receipt
protections remain enforced. Additional installed modules retaining a file
reference block deletion until their records have been handled appropriately.
Investigators can delete only their own eligible uploads on writable assigned
cases. Assigned case managers can manage eligible case uploads. Agency uploads
require an administrator. Clients cannot delete uploads.

VERIFY ON TEST SITE
Upload a small new PDF/photo to an open sample case. Confirm the readable file
and extension in Dropbox (or private server storage if Cloud is disconnected).
Download it through Case Files. Use Delete Upload, confirm the named sample file,
and verify it disappears from the case and its storage location.
Do not use the clean-install ZIP as an overwrite update of an existing site.
The cancelled legacy migration is not resumed by this patch.

VALIDATION
20 delivered PHP files parsed under PHP 8.3.11. Tests exercised actual byte
preservation/named local files, readable remote filenames, legacy path lookup,
deleted-file download denial, authorized physical deletion, failed deletion
retry, interrupted finalization recovery, and role/closed-case/approved-report/
evidence restrictions. Database and Dropbox deletion tests used controlled
adapters. Live hosting, MySQL and Dropbox behavior still require the sample test.
