Skip to main content

By using node sdk , file is uploaded and then after uploading file ,  I would like to get that uploaded file id. File is uploaded successfully response code s200. Althought I try out , I cannot get that uploaded file id. I cannot understand how can I get data from return Promise<Object> data type.
Therefore, could you support and find out solution for that issue. My code snippest is as below.
 

 // Initialize the Box SDK

              var sdk = new BoxSDK({

                clientID: sdkConfig.clientID,

                clientSecret: sdkConfig.clientSecret,

                appAuth: {

                    keyID: sdkConfig.appAuth.keyID,

                    privateKey: sdkConfig.appAuth.privateKey,

                    passphrase: sdkConfig.appAuth.passphrase

                }

            });

 

             var appUserClient = sdk.getAppAuthClient('user',userId);

              var stream =fs.createReadStream(newPath); // upload file’s path

              var parentFolderId = parentFolderId

              var fileName = files.uploadÂ0].originalFilename; // upload file’s name

 

             // File is uploaded

          var response =  appUserClient.files.uploadFile(parentFolderId,fileName,stream);

            // want to accept uploaded file’s id that step ※

 
 

 

 

Hi @Ei Ei Cho 👋 Welcome to Box community! The File ID should be returned in the response object. Can you please try to retrieve that in code? Kindly let us know how it goes!

In the event that this needs further investigation and assistance of our Product Support, you may submit a ticket by visiting our Support page. 👈


Reply