Query on uploading new file version using Box Node SDK function
回答済みHello Box team,
I have an app on Bluemix which connects to Box using Node SDK API functions and does various functions such as upload, download, preview, list files etc. Besides this, I would like to have a feature to upload updates to the same file already present recursively every two minutes, that is create new versions to the already uploaded file via the API calls. I observed that the function available for this as in the link:
http://opensource.box.com/box-node-sdk/Files.html
uploadNewFileVersion(fileID, content, callback) → {void}
But I am not sure how to get the fileID of the intially created file inorder to recursively write to it and create new versions via Box API.
Kindly guide. Thanks,
Swetha Gangadharan
-
For uploading the initial file, you use
uploadFile(parentFolderID, filename, content, callback)
That callback is "called with data about the upload if successful, or an error if the upload failed".
If the upload is successful, that data will look like the data in the example response given at https://docs.box.com/reference#upload-a-file . From there, you can retrieve the file id.
サインインしてコメントを残してください。
コメント
1件のコメント