strapi-provider-upload-webdav
v1.0.2
Published
WebDAV upload provider for Strapi v5
Downloads
6
Maintainers
Readme
📦 strapi-provider-upload-webdav
A Strapi v5 upload provider that stores media files in a WebDAV server instead of the local filesystem.Supports both buffer and stream uploads, deletion, configurable rootPath, and optional publicUrl.
✨ Features
Store files in any WebDAV-compliant server:
Full support for upload and delete lifecycle
Configurable via environment variables
Safe install/uninstall hooks:
Renames existing upload provider → oldPreWebdavUpload
Injects WebDAV config automatically
Restores old settings on uninstall
📥 Installation
bash
Plain textANTLR4BashCC#CSSCoffeeScriptCMakeDartDjangoDockerEJSErlangGitGoGraphQLGroovyHTMLJavaJavaScriptJSONJSXKotlinLaTeXLessLuaMakefileMarkdownMATLABMarkupObjective-CPerlPHPPowerShell.propertiesProtocol BuffersPythonRRubySass (Sass)Sass (Scss)SchemeSQLShellSwiftSVGTSXTypeScriptWebAssemblyYAMLXML npm install strapi-provider-upload-webdav # or yarn add strapi-provider-upload-webdav
⚙️ Configuration
Create or edit config/plugins.js (or config/plugins.ts if using TypeScript):
javascript
Plain textANTLR4BashCC#CSSCoffeeScriptCMakeDartDjangoDockerEJSErlangGitGoGraphQLGroovyHTMLJavaJavaScriptJSONJSXKotlinLaTeXLessLuaMakefileMarkdownMATLABMarkupObjective-CPerlPHPPowerShell.propertiesProtocol BuffersPythonRRubySass (Sass)Sass (Scss)SchemeSQLShellSwiftSVGTSXTypeScriptWebAssemblyYAMLXML module.exports = ({ env }) => ({ upload: { config: { provider: 'strapi-provider-upload-webdav', providerOptions: { baseUrl: env('WEBDAV_BASE_URL'), username: env('WEBDAV_USERNAME'), password: env('WEBDAV_PASSWORD'), rootPath: env('WEBDAV_ROOT_PATH', '/uploads/'), // default path publicUrl: env('WEBDAV_PUBLIC_URL'), // optional }, }, }, });
💡 On installation, this plugin will auto-generate this config if missing, and rename old upload settings to oldPreWebdavUpload.
🌍 Environment Variables
Add these to your .env file:
env
Plain textANTLR4BashCC#CSSCoffeeScriptCMakeDartDjangoDockerEJSErlangGitGoGraphQLGroovyHTMLJavaJavaScriptJSONJSXKotlinLaTeXLessLuaMakefileMarkdownMATLABMarkupObjective-CPerlPHPPowerShell.propertiesProtocol BuffersPythonRRubySass (Sass)Sass (Scss)SchemeSQLShellSwiftSVGTSXTypeScriptWebAssemblyYAMLXML # Base URL of your WebDAV server (must end with the WebDAV mount point) WEBDAV_BASE_URL=https://your-webdav-server.com/remote.php/webdav # Authentication WEBDAV_USERNAME=your-username WEBDAV_PASSWORD=your-password # Path inside WebDAV to store files (default: /uploads/) WEBDAV_ROOT_PATH=/uploads/ # Public URL (if files are served from CDN or reverse proxy) WEBDAV_PUBLIC_URL=https://cdn.yourdomain.com/uploads
🖥️ Setting up a WebDAV Server
This provider works with any WebDAV-compliant server. Here are popular options:
🚀 Usage
Uploading media from the Strapi Admin Panel or API will send files to your WebDAV server
File URLs are automatically set to WEBDAV_PUBLIC_URL if provided, otherwise fall back to the raw WebDAV URL
Deleting media in Strapi will also remove them from WebDAV
🛠️ Uninstall
bash
Plain textANTLR4BashCC#CSSCoffeeScriptCMakeDartDjangoDockerEJSErlangGitGoGraphQLGroovyHTMLJavaJavaScriptJSONJSXKotlinLaTeXLessLuaMakefileMarkdownMATLABMarkupObjective-CPerlPHPPowerShell.propertiesProtocol BuffersPythonRRubySass (Sass)Sass (Scss)SchemeSQLShellSwiftSVGTSXTypeScriptWebAssemblyYAMLXML npm uninstall strapi-provider-upload-webdav
Removes the WebDAV upload provider config
Restores your original upload settings (from oldPreWebdavUpload)
🧑💻 Development
Clone repo & link locally:
bash
Plain textANTLR4BashCC#CSSCoffeeScriptCMakeDartDjangoDockerEJSErlangGitGoGraphQLGroovyHTMLJavaJavaScriptJSONJSXKotlinLaTeXLessLuaMakefileMarkdownMATLABMarkupObjective-CPerlPHPPowerShell.propertiesProtocol BuffersPythonRRubySass (Sass)Sass (Scss)SchemeSQLShellSwiftSVGTSXTypeScriptWebAssemblyYAMLXML git clone https://github.com/yourusername/strapi-provider-upload-webdav cd strapi-provider-upload-webdav npm install npm link
Use in your Strapi app:
bash
Plain textANTLR4BashCC#CSSCoffeeScriptCMakeDartDjangoDockerEJSErlangGitGoGraphQLGroovyHTMLJavaJavaScriptJSONJSXKotlinLaTeXLessLuaMakefileMarkdownMATLABMarkupObjective-CPerlPHPPowerShell.propertiesProtocol BuffersPythonRRubySass (Sass)Sass (Scss)SchemeSQLShellSwiftSVGTSXTypeScriptWebAssemblyYAMLXML cd your-strapi-app npm link strapi-provider-upload-webdav
📜 License
MIT © 2025 — Maintainers & Contributors
Contact: Ejaz Arain - LinkedIn
