Cloud Storage Integrator - Online Help
Cloud Storage Integrator
Questions / Feedback?

UpdateResource Method

Updates the file or folder.

Syntax

box.updateResource([callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This method may be used to update a file or folder. The following properties are applicable when calling this method:

To move a resource to a new location set ResourceParentId and call this method.

If LocalFile, or ResourceData is specified the file content will also be updated. To update only the properties of the file without modifying the content set ResourceData and LocalFile to empty string.


//Update only the properties of the file.
box.LocalFile = "";
box.ResourceData = "";
box.ResourceTags = "tag1,tag2";
box.ResourceDescription = "New Description";
box.ResourceName = "NewName.txt";
box.UpdateResource();

//Update the properties and file data.
box.LocalFile = "..\\NewFileData.txt";
box.ResourceDescription = "Updated Today";
box.UpdateResource();

 
 
Copyright (c) 2017 /n software inc. - All rights reserved.
Build 1.0.6240.0