How to detect and clean corrupt .scz files in NodeJS (server-side)

Hi all,

We’re using HOOPS Communicator with a Service pod that downloads .scz (scene) files on-demand from a file service. The flow is:

  1. UI requests a model from Server side.

  2. Server downloads the .scz file and caches it locally.

  3. UI tries to load the .scz using loadSubtreeFromScz() (client API).

Problem:

  • If the .scz file is corrupt, the client sees a bad model key error.

  • The corrupt file remains in the pod cache, so every future request fails.

  • Service has no access to loadSubtreeFromScz(), because it’s a client-side API.

Question:
What’s the best approach to detect and clean corrupt .scz files on the server side before they reach the client?

We are thinking about:

  • Validating the .scz as a ZIP archive immediately after download.

  • Checking for manifest.json and basic internal structure.

  • Deleting the file if validation fails.

Has anyone implemented a server-side integrity check for .scz files in a similar HOOPS Communicator setup? Any best practices or ready-to-use patterns for Server side?

Hello @raja.r,

Well, on the server side, the converter has a list of error codes that may be helpful — please see Error Codes in our docs.

Also, there is a callback called modelLoadFailure which triggers on the client. You will have to capture the result and send it back to the server and handle it.