Azure copyBlob Node.js API Error -
does use copyblob node.js api copy blob 1 container other? tried use copyblob api in server scripts, gives me error such "error: container name format incorrect."
my code structure this:
blobservice.copyblob(uri, containername, blobname, function (error) { if (error != null) { console.log(error); } else { request.respond(); } });
my code provided below:
10 var blobservice = azure.createblobservice('mystorage', accountkey, 'mystorage.blob.core.windows.net'); 11 12 blobservice.copyblob("http://mystorage.blob.core.windows.net/e0f57621-20a3-4e17-b418-c0139c6daef8/myimage.jpg", "container1", "myimage.jpg", function (error) { 13 if (error != null) { 14 console.log(error); 15 } else { 16 console.log("success"); 17 } 18 });
and error message received is
error in script '/table/myblob.insert.js'. error: container name format incorrect. [external code] @ insert (</table/myblob.insert.js>:12:17) @ </table/myblob.insert.js>:1:8 [external code]
i'm pretty sure string format of containername correct.
please help.
thanks!
just posting sample code answer. take , delete afterwards.
var azure = require('azure'); var blobservice = azure.createblobservice("cynapta", "accountkey"); blobservice.copyblob("https://cynapta.blob.core.windows.net/mystorage-container1/tsmile.png", "mystorage-container2", "tsmile.png", function (error) { if (error != null) { console.log(error); } else { console.log("copied successfully."); } });
Comments
Post a Comment