IPWorks Cloud 2020 Node.js Edition

Questions / Feedback?

CreateObject Method

Creates a new object in the currently selected bucket.

Syntax

googlestorage.createObject(objectName, [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 creates a new object named Object in the bucket currently selected by Bucket. If there are any metadata items present in the Metadata* properties, they will included in the creation request.

If LocalFile is set the file will be uploaded from the specified path. If LocalFile is not set the data in ObjectData will be used.

To encrypt the file before uploading it, set EncryptionAlgorithm and EncryptionPassword. This method can automatically handle the multipart upload of objects (See Below). If it is desired to manually take control of the multipart upload process see StartMultipartUpload.

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