petrbroz / svf-utils

Utilities for working with the SVF file format used by Autodesk Platform Services.
https://petrbroz.github.io/svf-utils/
MIT License
131 stars 56 forks source link

normalize path for SVF Downloader #80

Closed lucaschadwicklam97 closed 6 months ago

lucaschadwicklam97 commented 6 months ago

When using the downloader via APS VS Code extension, the downloader downloads corrupt files with filenames that match objects_*.json.gz. From a manifest.json file retrieved from unzipping contents from the .svf file, the asset URI's for those objects include \..\ in the path, which, when normalized, will go up the directory, and thereby download the correct contents for the file.

I've tested this with Python and the files outputted after the normalizing the path are valid JSON and no longer corrupt.

lucaschadwicklam97 commented 6 months ago

hi @petrbroz, would you be able to review this? let me know if you need anything else from me

petrbroz commented 6 months ago

Thanks @lucaschadwicklam97, good catch! I'm surprised I haven't run into this issue before (the objects_*.json.gz would always download fine for me), but this code change looks like it would help in these kinds of scenarios.