node.js - Upload blobs with metadata, node -
how go uploading blob metadata azure in node? have:
blobservice.createblockblobfromtext(containername, function(error) { //what go in here? });
i see there link set blob metadata, can't interpret means.
does know if it's possible set blob metadata in node?
try code. creates blob in blob container using createblockblobfromtext
method , sets 2 metadata items blob:
var azure = require('azure'); testblobupload('testcontainer'); function testblobupload(containername) { var blobservice = azure.createblobservice('usedevelopmentstorage=true'); // error occurred @ line blobservice.createcontainerifnotexists(containername, {publicaccesslevel : 'blob'}, function(error){ if(!error) { console.log("container created successfully."); blobservice.createblockblobfromtext(containername, 'simplefile.txt', 'sample content', { metadata: { 'a': 'a', 'b': 'b', }}, function(error){ if(!error) { console.log("blob created text successfully."); } else { console.log("error: "+error); } }); } else { console.log("error: "+error); } }); }
Comments
Post a Comment