"Timeout Encountered in uploadFile Method with Box Node SDK"
Completed■ 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
-
Retrieve the Box SDK:
const sdk = BoxSDK.getPreconfiguredInstance(boxConfig)
-
Configure the proxy settings:
javascriptコードをコピーするsdk.configure({ proxy: { url: XXXXXX, username: ******, password: ****** } })
-
Retrieve the Box client:
const client = sdk.getAppAuthClient('enterprise')
-
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
}
}
}
Please sign in to leave a comment.
Comments
2 comments