daravel_s3
English ยท Bahasa Indonesia
A Daravel Storage disk on AWS S3 and
S3-compatible stores: Cloudflare R2, MinIO, DigitalOcean Spaces, Backblaze
B2, Wasabi and Google Cloud Storage. It reads Laravel's AWS_* variables,
so a Laravel and a Daravel application share one .env and one bucket.
dart pub add daravel_s3
Application.configure(basePath: '.').withS3() // AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_BUCKET, ...
await Storage.disk('s3').put('avatars/1.png', bytes);
await video.store('recordings', disk: 's3'); // multipart, one part in memory
final url = Storage.disk('s3').temporaryUrl('invoices/1029.pdf', expiration: 30.minutes.fromNow);
final upload = Storage.disk('s3').temporaryUploadUrl('materials/a.mp4',
expiration: 15.minutes.fromNow, contentType: 'video/mp4'); // url + headers for the client
- AWS Signature Version 4 in pure Dart, checked against AWS's published S3 examples; no AWS SDK, one AOT binary.
- Every
Diskmethod, held to the same contract tests as the core'sLocalDiskandMemoryDisk; server-side copy, batched deletes. - Streams upload in 8 MiB parts and download as they arrive.
- Presigned download and direct upload URLs, and POST forms that cap an
upload's size and type; all also on
Storage.fake().
Documentation: github.com/daravel-dev/daravel/blob/main/docs/guide/s3.md.
License and trademarks
MIT. "Laravel" is a trademark of Laravel Holdings Inc.; "Dart" is a trademark of Google LLC; Amazon S3 and AWS are trademarks of Amazon.com, Inc. or its affiliates; Cloudflare R2 is a trademark of Cloudflare, Inc. Daravel is an independent project, not affiliated with or endorsed by any of them.
Libraries
- daravel_s3
- S3 for Daravel: a
Diskon AWS S3 or any S3-compatible store (Cloudflare R2, MinIO, DigitalOcean Spaces, Google Cloud Storage), signed with a pure Dart AWS Signature Version 4, with streaming multipart uploads and presigned download and upload URLs.