{"id":48623,"library":"multer-storage-pkgcloud","title":"multer-storage-pkgcloud","description":"A multer storage plugin for uploading files to cloud object storage providers supported by pkgcloud (e.g., OpenStack, Amazon S3, Rackspace). Version 1.2.1 is the latest stable release. The package wraps pkgcloud's client to provide a drop-in multer storage engine. It requires multer >= 1.0.0 and pkgcloud itself. Minimal configuration: just a pkgcloud client and optional container/destination customization. Compared to other multer storage plugins (like multer-s3), this one is provider-agnostic via pkgcloud.","status":"active","version":"1.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/dustin-H/multer-storage-pkgcloud","tags":["javascript","multer","file upload","upload","cloud object storage","s3","openstack","nodejs","express"],"install":[{"cmd":"npm install multer-storage-pkgcloud","lang":"bash","label":"npm"},{"cmd":"yarn add multer-storage-pkgcloud","lang":"bash","label":"yarn"},{"cmd":"pnpm add multer-storage-pkgcloud","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Multer storage plugin – must be used with multer >= 1.0.0","package":"multer","optional":false},{"reason":"Provides cloud storage client (OpenStack, S3, etc.)","package":"pkgcloud","optional":false}],"imports":[{"note":"Package uses CommonJS only; no default export for ESM. Use require.","wrong":"import pkgcloudStorage from 'multer-storage-pkgcloud'","symbol":"pkgcloudStorage","correct":"const pkgcloudStorage = require('multer-storage-pkgcloud')"},{"note":"Module exports storage function directly, not as named export.","wrong":"const { pkgcloudStorage } = require('multer-storage-pkgcloud')","symbol":"pkgcloudStorage","correct":"const pkgcloudStorage = require('multer-storage-pkgcloud')"},{"note":"Multer also CommonJS-based; ESM may work but not guaranteed.","wrong":"import multer from 'multer'","symbol":"multer","correct":"const multer = require('multer')"}],"quickstart":{"code":"const express = require('express');\nconst multer = require('multer');\nconst pkgcloud = require('pkgcloud');\nconst pkgcloudStorage = require('multer-storage-pkgcloud');\n\nconst client = pkgcloud.storage.createClient({\n  provider: 'openstack',\n  username: process.env.OS_USERNAME ?? '',\n  password: process.env.OS_PASSWORD ?? '',\n  authUrl: process.env.OS_AUTH_URL ?? '',\n  region: process.env.OS_REGION ?? ''\n});\n\nconst storage = pkgcloudStorage({\n  client: client,\n  destination: function (req, file, cb) {\n    cb(null, {\n      container: 'my-container',\n      remote: 'uploads/' + file.originalname\n    });\n  }\n});\n\nconst upload = multer({ storage: storage });\n\nconst app = express();\napp.post('/upload', upload.single('file'), (req, res) => {\n  res.send('File uploaded successfully');\n});\napp.listen(3000);","lang":"javascript","description":"Shows how to set up a multer middleware with pkgcloud storage for file uploads using OpenStack, including client creation and destination function."},"warnings":[{"fix":"Upgrade multer to version 1.0.0 or higher.","message":"Requires multer >= 1.0.0; older multer versions are incompatible.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Consider using alternative multer storage plugins like multer-s3 or multer-google-cloud-storage.","message":"The package is no longer actively maintained; last release was in 2016.","severity":"deprecated","affected_versions":"all"},{"fix":"Switch to cloud-specific SDKs (e.g., @aws-sdk/client-s3 for S3) and use corresponding multer storage plugins.","message":"pkgcloud library itself is deprecated and no longer maintained; may have unpatched vulnerabilities.","severity":"gotcha","affected_versions":"all"},{"fix":"Use the destination function to generate unique remote paths, e.g., `${Date.now()}-${file.originalname}`.","message":"File naming collision: Without a custom destination function, files with the same originalname will overwrite each other in the container.","severity":"gotcha","affected_versions":"all"},{"fix":"Wrap multer middleware in try-catch or implement multer error handling (e.g., multer error middleware).","message":"No error handling for failed uploads; errors from pkgcloud are passed through but may be hard to debug.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.0.0':50 '1.2.1':26 'agnost':79 'amazon':22 'client':37,59 'cloud':13,87 'compar':64 'configur':55 'container/destination':62 'custom':63 'drop':42 'drop-in':41 'e.g':20 'engin':46 'express':93 'file':11,84 'javascript':82 'latest':29 'like':70 'minim':54 'multer':2,6,44,49,67,72,83 'multer-s3':71 'multer-storage-pkgcloud':1 'nodej':92 'object':14,88 'one':75 'openstack':21,91 'option':61 'packag':33 'pkgcloud':4,19,35,52,58,81 'plugin':8,69 'provid':16,39,78 'provider-agnost':77 'rackspac':24 'releas':31 'requir':48 's3':23,73,90 'stabl':30 'storag':3,7,15,45,68,89 'support':17 'upload':10,85,86 'version':25 'via':80 'wrap':34","created_at":"2026-06-07T16:57:35.539698+00:00","updated_at":"2026-06-07T16:57:35.539698+00:00","problems":[{"fix":"Ensure the field name in multer configuration matches the form input name exactly.","cause":"Mismatch between form field name and multer configuration (e.g., using upload.single('file') but form has field 'fieldname').","error":"Error: MulterError: Unexpected field"},{"fix":"Verify client is created with valid credentials and passed as { client: client } (not just client alone).","cause":"The pkgcloud client was not properly created or passed as undefined to pkgcloudStorage().","error":"TypeError: Cannot read property 'storage' of undefined"},{"fix":"Either create the container 'uploads' beforehand or specify a different container in destination function.","cause":"The default container 'uploads' does not exist in the cloud provider.","error":"Error: Container not found: uploads"},{"fix":"Check the authUrl and region; ensure connectivity to the endpoint.","cause":"Network error; pkgcloud could not reach the storage provider endpoint (e.g., auth URL incorrect or no internet).","error":"Error: ENOTFOUND in pkgcloud request"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/dustin-H/multer-storage-pkgcloud","github":"https://github.com/dustin-H/multer-storage-pkgcloud","docs":null,"changelog":null,"pypi":null,"npm":"multer-storage-pkgcloud","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}