Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var creationCallback = function (createError, createBlob, createResponse) {
if (createError) {
callback(createError, createBlob, createResponse);
} else {
// Automatically detect the mime type
if(azureutil.tryGetValueChain(options, ['contentSettings','contentType'], undefined) === undefined) {
azureutil.setObjectInnerPropertyValue(options, ['contentSettings','contentType'], mime.lookup(browserFile.name));
}
var stream = new BrowserFileReadStream(browserFile);
var streamCallback = function (createError, createBlob, createResponse) {
if (azureutil.objectIsFunction(stream.destroy)) {
stream.destroy();
}
callback(createError, createBlob, createResponse);
};
self._uploadBlobFromStream(true, container, blob, blobType, stream, browserFile.size, options, streamCallback);
}
};
var creationCallback = function (createError, createBlob, createResponse) {
if (createError) {
callback(createError, createBlob, createResponse);
} else {
// Automatically detect the mime type
if(azureutil.tryGetValueChain(options, ['contentSettings','contentType'], undefined) === undefined) {
azureutil.setObjectInnerPropertyValue(options, ['contentSettings','contentType'], mime.lookup(localFileName));
}
var stream = new FileReadStream(localFileName, { calcContentMd5: options.storeBlobContentMD5 });
var streamCallback = function (createError, createBlob, createResponse) {
if (azureutil.objectIsFunction(stream.destroy)) {
stream.destroy();
}
callback(createError, createBlob, createResponse);
};
self._uploadBlobFromStream(true, container, blob, blobType, stream, size, options, streamCallback);
}
};
value: function(filename) {
var guessedType = mime.lookup(filename);
return guessedType;
}
},