IPWorks Cloud 2020 Node.js Edition

Questions / Feedback?

CreateFolder Method

Creates a new folder.

Syntax

googledrive.createFolder(name, parentIds, [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, data){ }

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

'data' is the value returned by the method.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This method creates a new folder with the specified Name and returns its Id. ParentIds can be a list of existing folder Ids to use as parents for the new folder, or empty string to create the folder at the root of the drive.

If the IncludeFolderProperties configuration setting is true when this method is called, the class will include the metadata held by the first item in the Resource* properties when creating the folder. (Note that the Name and ParentIds passed to this method will take precedence.)

Google treats files and folders in the same way, and folders are included when listing resources. The ResourceType property can be used to determine if a resource is a folder or a file.

To list, delete, and update folders use the ListResources, DeleteResource, and UpdateResource methods.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Node.js Edition - Version 20.0 [Build 8265]