PresignUpload.
Signature
UploadOptions
Destination
Returns
A*dreep.MediaAsset:
The API sends
sizeBytes as a string, because Postgres BIGINT columns serialise that
way over JSON. The SDK decodes either form; call asset.SizeBytes.Int64() for the value.Transforming on upload
Anything inTransform is applied before storage, so the transformed result is what gets
stored and returned. The original is not kept.
Transform: &dreep.Transform{Preset: "thumbnail"}.
This counts against your plan’s monthly transformation quota. Transforming at delivery
time with URL instead keeps the original intact and serves any
number of variants from it.
Streaming large files
Upload writes the multipart body through an io.Pipe, so the file is streamed rather
than read into memory. When you know the size, pass KnownSize so the request carries an
exact Content-Length:
KnownSize doesn’t match the bytes actually read, the request fails.
Errors
Uploads are never retried automatically — see Errors & Retries.