I am trying to uploading file using azure-storage
function createBlockBlobFromLocalFile()
. But when i upload the file i am getting error like
{ Error: ENOENT: no such file or directory, stat 'D:\path\task1.txt'
errno: -4058, code: 'ENOENT', syscall: 'stat', path: 'D:\path\task1.txt' }
But my file is inside the same path that i am using to run the file. So this means the uploading file and code both in same folder. Here is the code which i am trying to upload
var azureStorage = require('azure-storage');
var blobUri = "http://accountname.blob.core.windows.net";
var blobService = azureStorage.createBlobServiceWithSas(blobUri, sasKey).withFilter(new azureStorage.ExponentialRetryPolicyFilter());
blobService.createBlockBlobFromLocalFile('container', 'taskblob', 'task1.txt', function(error, result, response) {
if (!error) {
console.log("uplaoded");
} else {
console.log(error);
}
});