Skip to content

[Bug] backupCase generates ZIP archives with deeply nested server system paths instead of relative case folders #403

@tejassinghbhati

Description

@tejassinghbhati

Summary

The /backupCase endpoint generates ZIP archives that retain the absolute filesystem path of the host server rather than correctly packaging the backup as a relative directory. This occurs in API/Routes/Upload/UploadRoute.py, where zipObj.write(filePath) is executed without passing an arcname parameter. As a result, the backend zips the entire host directory tree (e.g., e/MUIOGO/MUIOGO/WebAPP/DataStorage/MyCase/...) into the backup instead of just the case files.


Expected behavior

When downloading a case backup, the ZIP archive should only contain the relative files of the case. Extracting it on a local machine should immediately yield the user's data (e.g., genData.json), without forcing them to navigate through deeply nested folders that mimic the backend host's server configuration.

Reproduction steps

  1. Send a POST or GET request (or click the designated UI button) to trigger a backup for an existing case via /backupCase.
  2. Wait for the ZIP archive to be generated and downloaded to your local machine.
  3. Extract the downloaded ZIP archive.
  4. Navigate into the output folder.

Observed Result:
Instead of seeing the backup case data immediately, you are forced to click through the server's drive letter and full path trace (e.g., <drive>/MUIOGO/MUIOGO/WebAPP/DataStorage/<Casename>/).

Environment

  • OS: occurs on both Windows and Linux hosts
  • Python version: Any
  • Branch: main

Logs or screenshots

Image

Related work checked

Checked existing branches and PRs regarding /backupCase. While there is an existing branch that addresses the thread timeout bug for this endpoint, the archive path structure has not been corrected anywhere.

Proposed track

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions