最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

express - Deleting Files from Autodesk Viewer - Stack Overflow

programmeradmin7浏览0评论

I want to be able to delete files from the Autodesk Viewer. When I delete them - I want them to disappear from my dropdown and not appear as "Model not translated".

I was using the code from this tutorial - /.

For context, I tried to download models and the solution I found was:

service.downloadObject = async (urn) => {
  const { access_token } = await service.getInternalToken();

  let decodedUrn = Buffer.from(urn, "base64").toString("utf8");

  let urnParts = decodedUrn
    .replace("urn:adsk.objects:os.object:", "")
    .split("/");

  let bucketKey = urnParts[0];
  let objectKey = urnParts[1];

  try {
    const response = await fetch(
      `/${bucketKey}/objects/${objectKey}/signeds3download`,
      {
        method: "GET",
        headers: {
          Authorization: `Bearer ${access_token}`,
        },
      }
    );

    const data = await response.json();
    return data.url;
  } catch (err) {
    console.error("Error fetching download URL:", err);
    throw new Error("Failed to retrieve download URL.");
  }
};

Initially, I tried with let response = await ossClient.signedS3Download(bucketKey, objectKey, { accessToken }); for downloading models which gave me a 401 Unauthorized Error. Could I please get some help creating a similar method to completely delete models?

Thank you!

发布评论

评论列表(0)

  1. 暂无评论