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
- Send a
POST or GET request (or click the designated UI button) to trigger a backup for an existing case via /backupCase.
- Wait for the ZIP archive to be generated and downloaded to your local machine.
- Extract the downloaded ZIP archive.
- 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
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
Summary
The
/backupCaseendpoint 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 inAPI/Routes/Upload/UploadRoute.py, wherezipObj.write(filePath)is executed without passing anarcnameparameter. 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
POSTorGETrequest (or click the designated UI button) to trigger a backup for an existing case via/backupCase.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
mainLogs or screenshots
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