20 Jan 2023
File versioning in buckets
Unlike on our user data storage services like Fusion Team or Autodesk Docs, on the underlying service called OSS (Object Storage Service) we do not provide file versioning out of the box - that's something you have to implement if you need it.
On OSS it is possible to upload a different file (e.g. a new version of an existing file) in a bucket with the exact same name, thereby overwriting the original content.
You can also regenerate the derivatives (e.g. SVF format) for it as well.
However, that can cause some issues when e.g. you want to view the model in the browser, as the Viewer takes advantage of caching, resulting in the previous version of the model showing up.
There is a workaround for it discussed here: Viewer keeps showing old model
SVF2 takes advantage of caching even more and the above solution does not work for it.
This format was originally focusing on the user data storage services where two versions of the same file cannot have the same file id or urn. The display name of the file stays the same, but under the hood, in the bucket, a different file name (a GUID) is used for each version - see picture on top.
(you can use the GET version endpoint to find the storage id of a file version)
There might be workarounds for the caching issue of SVF2 as well, but the best solution is to not use the same file name for different versions of the same file.
You can come up with any naming convention you want:
- append the date & time the file was uploaded: mypart[2009-09-01T20:31:12.056Z].ipt
- append the version number of the file: mypart[v1].ipt, mypart[v2].ipt, etc
- use a GUID as file name and keep track of the original name in a database: 89e31ef2-b98e-4cc4-8bca-0ed4f4292428.ipt
- etc
Apart from not having to worry about caching issues anymore, this also enables you to view previous versions of a model.