Download the PHP package kaibatech/viettel-cloud-s3 without Composer
On this page you can find all versions of the php package kaibatech/viettel-cloud-s3. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package viettel-cloud-s3
Viettel Cloud Object Storage - Laravel Storage Driver
A Laravel Storage driver for Viettel Cloud Object Storage and other VIPCore/EMC ViPR S3-compatible endpoints that have signature compatibility issues with the standard AWS SDK for PHP.
✨ Features
- ✅ Full Laravel Storage integration - Use familiar
Storage::disk()methods - ✅ Upload, download, delete files with proper error handling
- ✅ File existence checks and metadata retrieval
- ✅ Public/private file visibility support (with ACL headers)
- ✅ MIME type detection for uploaded files
- ✅ URL generation for public file access
- ✅ Custom AWS v4 signature calculation compatible with VIPCore/EMC ViPR
- ✅ UNSIGNED-PAYLOAD support required by some S3-compatible services
- ✅ Laravel 10.x, 11.x & 12.x support
🚀 Installation
Install the package via Composer:
Laravel Auto-Discovery
The package uses Laravel's auto-discovery feature, so the service provider will be registered automatically.
For Laravel versions that don't support auto-discovery, add the service provider to your config/app.php:
Publish Configuration (Optional)
If you want to customize the configuration, publish the config file:
⚙️ Configuration
Add a new disk to your config/filesystems.php:
Environment Variables
Add these variables to your .env file:
Alternative: Use Existing AWS Environment Variables
If you're migrating from AWS S3, you can reuse your existing environment variables:
📖 Usage
Basic File Operations
File Upload with Form Validation
Batch Operations
Working with Streams
File Metadata
🔧 Advanced Configuration
Custom User Agent
The driver uses a default user agent viettel-cloud-s3/1.0 callback. This is configured in the adapter and matches the working signature requirements.
File Visibility and ACL
⚠️ VIPCore Limitation: While the driver correctly sends ACL headers, VIPCore/EMC ViPR may not support anonymous public access like AWS S3. Files may still require authentication regardless of the ACL setting.
Error Handling
🏗️ How It Works
The Problem
Standard AWS SDK for PHP calculates signatures differently than what VIPCore/EMC ViPR S3-compatible services expect, causing SignatureDoesNotMatch errors.
The Solution
This package provides a custom Flysystem adapter that:
- Manually calculates AWS v4 signatures using the exact format expected by VIPCore
- Forces
UNSIGNED-PAYLOADcontent hash (required by VIPCore) - Uses direct cURL requests bypassing AWS SDK signature issues
- Implements proper header formatting based on working examples
Key Components
- Custom signature calculation compatible with VIPCore/EMC ViPR
- Proper canonical request formatting with alphabetical header ordering
- UNSIGNED-PAYLOAD handling for all requests
- cURL-based HTTP client for direct control over requests
🔒 Security
- Uses AWS v4 signature validation
- Proper credential handling through Laravel configuration
- Request timestamp validation prevents replay attacks
- Content integrity checks with SHA256 hashing
- Supports both public and private file access controls
🧪 Testing
After installation, you can test the integration with a simple script:
🐛 Troubleshooting
Common Issues
1. SignatureDoesNotMatch Error
- ✅ Solved by this package! The custom signature calculation handles VIPCore compatibility.
2. File Upload Fails
- Check your credentials in
.env - Verify bucket name and endpoint URL
- Ensure network connectivity to the endpoint
3. File URLs Don't Work
- Verify the
VIETTEL_S3_URLenvironment variable - Check if the bucket and file permissions are correct
- Remember that VIPCore may require authentication even for "public" files
4. Large File Uploads
- Use
putStream()for large files instead ofput() - Consider implementing chunked uploads for files > 100MB
Debug Mode
Enable debug logging in your Laravel application to see detailed request/response information:
Check storage/logs/laravel.log for detailed error information.
📋 Requirements
- PHP: ^8.2
- Laravel: ^10.0 || ^11.0 || ^12.0
- League/Flysystem: ^3.0
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📝 License
This package is open-sourced software licensed under the MIT license.
🏢 Support
- Issues: GitHub Issues
- Documentation: This README and inline code documentation
- Community: Feel free to open discussions for questions and feature requests
🎯 Roadmap
- [ ] Add support for multipart uploads
- [ ] Implement proper directory listing (ListObjects API)
- [ ] Add comprehensive test suite
- [ ] Support for more VIPCore-specific features
- [ ] Performance optimizations and caching
🎉 Happy coding with Viettel Cloud Object Storage!
All versions of viettel-cloud-s3 with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/filesystem Version ^10.0|^11.0|^12.0
league/flysystem Version ^3.0