Upload large files to Google Cloud Storage using resumable uploads and generate signed URLs for temporary access

domain: google-cloud-storage · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Authenticate using a service account key or Application Default Credentials (ADC); obtain an OAuth2 access token with scope https://www.googleapis.com/auth/devstorage.read_write
  2. Initiate a resumable upload by sending a POST to https://storage.googleapis.com/upload/storage/v1/b/{bucket}/o?uploadType=resumable with the Content-Type header set to the object's MIME type and an X-Goog-Upload-Command: start header; the response Location header contains the session URI
  3. Upload file data in chunks (recommended 8 MiB aligned chunks) by sending PUT requests to the session URI with Content-Range headers specifying byte range and total size; retry any 5xx or network failure from the last committed byte
  4. Finalize the upload by sending the last chunk with Content-Range indicating the final byte; a 200 or 201 response confirms the object is committed
  5. Generate a signed URL for temporary object access using the GCS Signing API or client libraries: specify expiration (max 7 days for service-account-signed V4 URLs), HTTP method, and optionally required headers; sign the canonical request with the service account private key
  6. For short-lived access patterns, prefer V4 signed URLs (signBlob API or client library) and set the Content-Disposition or response-content-type query params to control browser behavior

Known gotchas

Related routes

Upload large files to Azure Blob Storage using block uploads and generate SAS tokens for time-limited access
azure-blob · 6 steps · unrated
S3 multipart upload for large files
docs.aws.amazon.com · 6 steps · unrated
Access Cloudflare R2 storage using the S3-compatible API and generate presigned URLs
cloudflare-r2 · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans