Skip to main content
Question

"Timeout Encountered in uploadFile Method with Box Node SDK"

  • May 27, 2025
  • 2 replies
  • 17 views

Forum|alt.badge.img

■ Executed API
Box Files Upload API

■ Method of Execution
Using the box-node-sdk, the method is executed in the format "client.files.uploadFile(folderID, 'My File.pdf', stream)" as per the official documentation.

■ Steps of Execution

  1. Retrieve the Box SDK:
    const sdk = BoxSDK.getPreconfiguredInstance(boxConfig)

  2. Configure the proxy settings:

    javascript
    コードをコピーする
    sdk.configure({ proxy: { url: XXXXXX, username: ******, password: ****** } })
  3. Retrieve the Box client:
    const client = sdk.getAppAuthClient('enterprise')

  4. Execute the file upload:
    client.files.uploadFile(folderID, 'My File.pdf', stream)
    Note: The file size at the time of timeout was 4.3KB.

■ Expected Outcome
Receive a response in accordance with the IF specifications from the Box API.

■ Actual Outcome
A timeout occurred during the uploadFile operation.



{
    "code": "ESOCKETTIMEDOUT",
    "connect": false,
    "request": {
        "uri": {
            "protocol": "https:",
            "slashes": true,
            "auth": null,
            "host": "upload.box.com",
            "port": 443,
            "hostname": "upload.box.com",
            "hash": null,
            "search": null,
            "query": null,
            "pathname": "/api/2.0/files/content",
            "path": "/api/2.0/files/content",
            "href": "https://upload.box.com/api/2.0/files/content"
        },
        "method": "POST",
        "headers": {
            "User-Agent": "Box Node.js SDK v3.4.2 (Node v18.20.3)",
            "Authorization": "[REMOVED BY SDK]",
            "X-Box-UA": "agent=box-node-sdk/3.4.2; env=Node/18.20.3",
            "host": "upload.box.com",
            "accept": "application/json",
            "content-type": "multipart/form-data; boundary=--------------------------798606804367054831219428",
            "content-length": 4753
        }
    }
}

2 replies

Forum|alt.badge.img
  • Author
  • Box Employee
  • 34738 replies
  • May 27, 2025

I don't understand why the expected value is not returned and it times out...

※ i use google translation


Forum|alt.badge.img
  • Author
  • Box Employee
  • 34738 replies
  • May 27, 2025

Hi there, 

Welcome to Box Community! 

To help with your error, I created a new ticket and a member from Box Product Support will be in touch, please keep an eye out. 

Thanks for posting!