2

I am new to Autodesk-Forge API and I am trying to use the sample dmSample.js, included in the node.js SDK.

The example works well for very small files (up to 500 Kb)

However, when I try to upload larger files, (even just 1 Mb), the execution stops after few seconds with the following error message :

Error: { Error: ESOCKETTIMEDOUT
     at ClientRequest.<anonymous> (C:\node.js dev\forge-api-nodejs-client node_mo dules\request\request.js:819:19)
     at ClientRequest.g (events.js:292:16)
     at emitNone (events.js:86:13)
     at ClientRequest.emit (events.js:185:7)
     at TLSSocket.emitTimeout (_http_client.js:629:10)
     at TLSSocket.g (events.js:292:16)
     at emitNone (events.js:86:13)
     at TLSSocket.emit (events.js:185:7)
     at TLSSocket.Socket._onTimeout (net.js:338:8)
     at ontimeout (timers.js:386:14) code: 'ESOCKETTIMEDOUT', connect: false 
}

The file I am trying to upload is 30 Mb and is on my local post.

Any idea ?

Augusto Goncalves
  • 8,493
  • 2
  • 17
  • 44
Marcello
  • 43
  • 3

1 Answers1

0

I was able to fix it by increasing the value of the timeout of the request module.

Forge uses a wrapper that it is located in

/src/ApiClient.js

Search for this.timeout and set it to something like.

this.timeout = 600000;
Julio Ojeda
  • 767
  • 1
  • 6
  • 24