maximus Posted Monday at 06:32 AM Posted Monday at 06:32 AM I’ve been working on a module to store ProcessWire files directly on Backblaze B2, and wanted to share it with the community. Why I Built This I needed to host video content without breaking the bank on storage costs. AWS S3 was too expensive, and I wanted something that integrates seamlessly with ProcessWire’s existing file fields. Key Features 🚀 Direct B2 Upload - Files go straight to Backblaze, no local storage needed 💰 Dirt Cheap - $6/TB/month (AWS S3 costs 5x more) 🌐 Custom Domain Support - Use your own CDN domain ⚡ Cloudflare Integration - Combine with Cloudflare for FREE bandwidth 📦 Works with Repeaters - Multiple files per repeater item 🎬 Perfect for Video - Tested with Plyr, Video.js, and HTML5 video Real Cost Savings Here’s what I’m actually paying for 500GB of video storage: Backblaze B2 + Cloudflare: - Storage: $3/month - Bandwidth: $0 (free via Cloudflare Bandwidth Alliance) - Total: $3/month AWS S3 (same usage): - Storage: $11.50/month - Bandwidth: $450/month (5TB) - Total: $461.50/month That’s a 99% savings on bandwidth costs! How It Works The module extends ProcessWire’s file fields to upload directly to Backblaze B2. You can use it just like regular file fields: // Single video <video controls> <source src="<?= $page->b2_video->url ?>" type="video/mp4"> </video> // Multiple videos in repeater <?php foreach($page->videos as $item): ?> <?php foreach($item->b2_video as $video): ?> <video controls> <source src="<?= $video->b2url ?>" type="video/mp4"> </video> <?php endforeach; ?> <?php endforeach; ?> Cloudflare CDN Integration Want free bandwidth? Here’s the magic setup: CNAME: cdn.yourdomain.com → f005.backblazeb2.com (with Cloudflare proxy) Transform Rule: Rewrite paths to include /file/bucket-name/ Module setting: Enable custom domain Now all files serve through Cloudflare’s global CDN with zero bandwidth costs thanks to the Bandwidth Alliance partnership. Setup is Simple Create Backblaze B2 bucket Configure module with API keys Create field (type: FieldtypeFileB2) Add field to template Upload files - they go straight to B2! Optional: Add Cloudflare for free bandwidth and caching. Use Cases Video hosting (my use case) Large image galleries Audio files / podcasts Downloadable resources Any high-bandwidth file hosting Technical Details Works with public and private buckets Supports custom Cache-Control headers Files are deleted from local server after upload Can use custom domains via Cloudflare CORS configurable for cross-domain access Try It Out GitHub: https://github.com/mxmsmnv/FieldtypeFileB2 9 2
maximus Posted 9 hours ago Author Posted 9 hours ago Live demo running here: https://media.smnv.org/ Attached below is the full, ready-to-go 2025 site profile site-media.zip. It’s the complete real-world implementation of FieldtypeFileB2: videos served straight from Backblaze B2, zero bandwidth cost via Cloudflare, everything polished and production-ready. Grab it, use it, butcher it — whatever you need. 1 1
Ivan Gretsky Posted 9 hours ago Posted 9 hours ago Haven't tried the profile or field, but the walks in Switzerland videos are truly awesome) Wonder if page variations are being created well on the fly. Is it taken care of?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now