castro nelson
castro nelson

Reputation: 1

Exception when calling Autodesk forge API

I am using web application with forge viewer.When uploading 1GB file in forge viewer its throwing exception.

This error is getting from below line of coding.

 newObject = Await objectsApi.UploadObjectAsync(bucketKey, m_strFileName,
                     Convert.ToInt32(fileStream.BaseStream.Length), fileStream.BaseStream,
                       "application/octet-stream")

Exception message : Error calling UploadObject

at Autodesk.Forge.ObjectsApi.d__57.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Autodesk.Forge.ObjectsApi.d__56.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at CommonGUI.mtequipments.VB$StateMachine_2279_btn_bimfile_Click.MoveNext() in D:\Projects

Could you please help me for this. I need to upload large size files in forge viewer.

Upvotes: 0

Views: 226

Answers (1)

Eason Kang
Eason Kang

Reputation: 7070

There is a great possibility that the upload has timeouted.

For large model file, please consider using the resumable endpoint PUT buckets/:bucketKey/objects/:objectName/resumable. In C# SDK, it's uploadchunk.

Here is an example: https://github.com/yiskang/ForgeResumableUploadProgressDemo/blob/master/ForgeResumableUploadProgressDemo/Program.cs

Upvotes: 0

Related Questions