📋 Description
In forensic analysis, an investigator rarely needs just one format. They usually require the PDF for legal documentation, the CSV for further data manipulation, and the JSON for integration into other systems.
Currently, users have to click three separate buttons to download these formats individually. To streamline the forensic workflow, we should add an "Export Package" feature that generates all formats, compresses them into a single .ziparchive, and downloads it in one click.
🎯 Proposed Solution
Create a new FastAPI backend endpoint that generates all three files in-memory, packages them into a ZIP archive, and streams it to the frontend.
Required Steps:
- Backend Update (
main.py):
- Create a new endpoint (e.g.,
GET /export/zip/{session_id}).
- Utilize Python's built-in
io.BytesIO() and zipfile.ZipFile to create an in-memory ZIP archive.
- Call the existing export logic to generate the PDF, CSV, and JSON data.
- Write these three files into the in-memory ZIP.
- Return a
StreamingResponse with the application/zip media type.
- Frontend Update (
html/ and js/):
- In the Export Centre section of the dashboard, add a new primary button: "Export Evidence Package (ZIP)."
- Update the JavaScript to trigger a download from the new `/export/zip/ "endpoint" when clicked.
📋 Description
In forensic analysis, an investigator rarely needs just one format. They usually require the PDF for legal documentation, the CSV for further data manipulation, and the JSON for integration into other systems.
Currently, users have to click three separate buttons to download these formats individually. To streamline the forensic workflow, we should add an "Export Package" feature that generates all formats, compresses them into a single
.ziparchive, and downloads it in one click.🎯 Proposed Solution
Create a new FastAPI backend endpoint that generates all three files in-memory, packages them into a ZIP archive, and streams it to the frontend.
Required Steps:
main.py):GET /export/zip/{session_id}).io.BytesIO()andzipfile.ZipFileto create an in-memory ZIP archive.StreamingResponsewith theapplication/zipmedia type.html/andjs/):