Skip to content

[FEATURE]: "Export Package" Button to Download PDF, CSV, and JSON in a Single ZIP #131

Description

@diyamajee-spec

📋 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:

  1. 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.
  1. 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.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions