
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
@neoxia-js/multer-azure
Advanced tools
Streaming multer storage engine for Azure Blob storage. Forked from multer-azure
This is a multer storage engine for Azure's blob storage.
yarn add @neoxia-js/multer-azure
var express = require('express')
var multer = require('multer')
var multerAzure = require('multer-azure')
var app = express()
var upload = multer({
storage: multerAzure({
connectionString: '[Azure Storage Connection String]', //Connection String for azure storage account, this one is prefered if you specified, fallback to account and key if not.
account: '[Azure Storage Account]', //The name of the Azure storage account
key: '[Azure Storage Account Key]', //A key listed under Access keys in the storage account pane
container: '[Blob Container Name]' //Any container name, it will be created if it doesn't exist
blobPathResolver: function(req, file, callback){
var blobPath = yourMagicLogic(req, file); //Calculate blobPath in your own way.
callback(null, blobPath);
}
})
})
app.post('/', upload.any(), function (req, res, next) {
console.log(req.files)
res.status(200).send('Uploaded: ' + req.files)
})
multer-azure will return the following information in each file in the req.files parameter:
| Key | Description |
|---|---|
fieldname | The field name/key sent in the post request with the image. |
originalname | The full original name of the file. |
encoding | The file encoding. |
mimetype | The MIME type of the file. |
filename | The file name in the azure storage. |
container | The azure storage container where the file upload to. |
blobPath | The full blobName (or we call it blobPath). |
url | The full url of the file just got uploaded. |
Files in an Azure container have to have a unique name. multer-azure allows you to customize the blobPath.
Simply provide a blobPathResolver, the same way as what you do with multer.diskStorage.
blobPathResolver: function(req, file, callback){
var blobPath = yourMagicLogic(req, file);//Calculate blobPath in your own way.
callback(null, blobPath);
}
If you don't provide a blobPathResolver, a default file name is generated:
Date.now() + encodeURIComponent(new Buffer([FILENAME]).toString('base64')) + extension.
This results in a url safe filename that looks like "1480994807566-Qmx1ZVBUQ0xvZ29MQVJHRTIwMTYuanBn.jpg", which is most likely overkill.
The connectionString will be prefered if you pass it, otherwise please provide account and key.
The account is just the name of your storage account that you've created in Azure. For information on how to do this, check out this tutorial.
The key for the key field can be obtained under the Access keys section in the storage account pane in Azure.
The container name can be anything you choose, as long as it's unique to the storage account and as long as it fits Azure's naming restrictions. If the container does not exist the storage engine will create it.
FAQs
Streaming multer storage engine for Azure Blob storage. Forked from multer-azure
We found that @neoxia-js/multer-azure demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.