Skip to content Skip to sidebar Skip to footer

Download File From Autodesk Forge 3d Viewer

How do I download a file from the 3D viewer in Autodesk Forge. I am using 2 legged authorization and I am able to upload files to the bucket, but I am not sure how to download the

Solution 1:

I am able to download files now, from Javascript use $.ajax with the url path to the method in .NET then use:

WebClient client = new WebClient();
Uri address = new Uri(storageLocation);
fileName = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\" + fileName;
client.Headers.Add("Content-Type", "application/octet-stream");
client.Headers.Add("Authorization", "Bearer " + credentials.TokenInternal);
client.DownloadFileAsync(address, fileName);
return client;

This will download files to the desktop.

Solution 2:

You can also try this endpoint:

https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectName-GET/

It will download an object from the Bucket location you specify.

This is a REST endpoint you can check both the NPM or NuGet we have to see if that function is already available. In case is not please submit a request to be include it.

Post a Comment for "Download File From Autodesk Forge 3d Viewer"