I am using createBlockBlobFromLocalFile()
function to upload the file to azure-storage
. Here is the code,
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("uploaded");
} else {
console.log(error);
}
});
when i run the above code i am getting error like
events.js:183 throw er; // Unhandled 'error' event ^
Error: ENOENT: no such file or directory, read
My file path and code are in same folder like
D:\path\upload.js
D:\path\task1.txt
I checked the file availability using below code, it returns as success,
var fs = require('fs');
if (fs.existsSync('task1.txt')) { }
Please someone suggest me a solution for this,
UPDATE : Error message is different from this question