Uploaded Media File Delete Update

This commit is contained in:
2026-02-22 13:04:04 -05:00
parent 3d936d8a6f
commit 3b4d5e4080
16 changed files with 701 additions and 451 deletions

View File

@@ -71,4 +71,14 @@ Renames a specific simulation. Automatically updates the database and physically
Uploads a new media or data resource file directly into a completed simulation run. Supports both images (e.g., PNGs) and heavy video files (e.g., AVIs) out of the box with an initial multi-part allocation pool mapping of 500 MB.
- **Request Data:** `multipart/form-data` packet using the `file` keyword carrying the binary data blocks.
- **Behavior:** The Go service validates the simulation ID exists, dynamically builds the memory pool, opens a stream writer caching the binary blob into the `../results/simulation_X/filename.ext` directory path, and records the resource in the primary SQLite instance.
- **Response:** JSON object `{"status": "success", "filename": "example.png"}`
- **Response:** JSON object `{"status": "success", "filename": "example.png"}`
### `DELETE /api/simulations/:id`
Permanently deletes a complete simulation from the platform.
- **Behavior:** Deletes the record from the SQLite database along with any bound resource hooks. It subsequently initiates a full removal of the linked `../results/:name` directory natively off the OS to completely recover physical disk space.
- **Response:** JSON object `{"status": "success"}`
### `DELETE /api/simulations/:id/resources/:filename`
Deletes a specific user-uploaded media asset or log file dynamically out of a simulation without dropping the core simulation entity itself.
- **Behavior:** Detaches the file association string from SQLite and forces an OS-level file drop directly onto the specific asset file stored within the simulation's results directory.
- **Response:** JSON object `{"status": "success"}`