简体   繁体   中英

autodesk forge “Failed to trigger translation for this file”

I am trying to use the autodesk forge viewer tutorial

https://developer.autodesk.com/en/docs/model-derivative/v2/tutorials/prepare-file-for-viewer/

I have successfully uploaded and downloaded a dwg file

on the step where i convert it to svf it never seems to process and fails with

{"input":{"urn":"Safe Base64 encoded value of the output of the upload result"},"output":{"formats":[{"type":"svf","views":["2d","3d"]}]}}
HTTP/1.1 400 Bad Request
Result{"diagnostic":"Failed to trigger translation for this file."}

First question do i need to remove the urn: before Base64 encoding. Second is there any more verbose error result that I can see.

Note I have also tried with a rvt file and tried with "type":"thumbnail" nothing seems to work.

I feel my Encoded URN is incorrect but I am not sure why it would be. On the tutorial page they seem to have a much longer and raw urn not sure if I should be appending something else to it before encoding. they have a version and some other number

from tutorial raw "urn:adsk.a360betadev:fs.file:business.lmvtest.DS5a730QTbf1122d07 51814909a776d191611?version=12"

mine raw
"urn:adsk.objects:os.object:gregbimbucket/XXX"

EDIT: This is what i get back from the upload of a dwg file

HTTP/1.1 200 OK
Result{
"bucketKey" : "gregbimbucket",
"objectId" : "urn:adsk.objects:os.object:gregbimbucket/XXX",
"objectKey" : "XXX",
"sha1" : "xxxx",
"size" : 57544,
"contentType" : "application/octet-stream",
"location" : "https://developer.api.autodesk.com/oss/v2/buckets/gregbimbucket/objects/XXX"
}

This is what i send to convert the file

{"input":{"urn":"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldC9YWFg"},"output":{"formats":[{"type":"svf","views":["2d","3d"]}]}}

This is the error I get back

HTTP/1.1 400 Bad Request
Result{"diagnostic":"Failed to trigger translation for this file."}

EDIT 2: SOLUTION It looks like the object_id when uploading a file has to have the file extension and not end in a GUI or random set of characters for it to know what file type it is. So that it can be converted.

"objectId" : "urn:adsk.objects:os.object:gregbimbucket/Floor_sm.dwg", 

解决方案看起来,上载文件时的object_id必须具有文件扩展名,并且不能以GUI或随机字符结尾,以使其知道文件的类型。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM