Google Drive as Your Media Storage and CDN API

An open-source media gateway that streams file uploads directly into your personal Google Drive and serves on-the-fly resized WebP and AVIF images.

Uses your standard Google Drive quota Direct multipart upload streaming MIT Licensed open source

System Architecture

How Driveinary bridges your client applications with Google Drive storage.

1. OAuth Connection

Connect via Google OAuth2 with scoped permissions limited strictly to files created by Driveinary.

2. Scoped API Keys

Generate API keys with optional allowed origin restrictions to protect your credentials in production.

3. Streaming Upload

Uploads are piped through server memory directly into Google Drive folders without temporary disk writes.

4. Dynamic Delivery

Sharp resizes and transcodes source images to WebP/AVIF on request, cached via HTTP headers.

API Examples

Standard REST endpoints for media management.

Upload Media
POST /api/v1/upload
curl -X POST https://drive.yoepan.my.id/api/v1/upload \
  -H "Authorization: Bearer drv_live_xxxxxxxx" \
  -F "file=@photo.jpg" \
  -F "folder=products"

Returns the unique asset ID, MIME type, dimensions, and secure public CDN streaming URL.

Image Transformations
GET /media/:id
<!-- Original source image -->
<img src="https://drive.yoepan.my.id/media/clx123abc" />

<!-- Transformed: WebP, 400px width, 80% quality -->
<img src="https://drive.yoepan.my.id/media/clx123abc?w=400&format=webp&q=80" />

Supports width, height, format (webp, avif, jpeg, png), and quality query parameters.

Architecture Comparison

Understanding trade-offs between media storage approaches.

AspectDriveinaryCloudinaryAWS S3
Storage BackendGoogle Drive accountProprietary cloudAWS S3 Buckets
Storage BillingIncluded in Google quotaCredit tiers ($99/mo standard)Per GB stored + egress fees
Setup ComplexityGoogle OAuth loginAccount signupIAM roles and bucket policies
On-the-fly ResizeIncluded (Sharp engine)Included (credit-metered)Requires Lambda setup
Source CodeMIT Open SourceProprietaryProprietary API
Primary FitIndie apps, creators, internal toolsEnterprise marketing platformsHigh-scale cloud infrastructure