Quick start
This guide signs an upload URL on your server, uploads a file from the command line and loads it back through a signed download URL.
What we set up with you
Section titled “What we set up with you”When your account is opened, we give you:
- a space name, eight lower-case letters and digits, such as
k3x9q2m7; - the hostnames for that space:
<space>.edge.binedge.netfor public files,<space>.vault.binedge.netfor private files and<space>.upload.binedge.netfor uploads; - a production signing key and a development signing key. Keep them on your servers only.
1. Sign an upload URL
Section titled “1. Sign an upload URL”Your server decides where the file goes, how large it may be, which types are accepted and when the URL expires. With the Laravel disk:
$upload = Storage::disk('binedge')->temporaryUploadUrl( 'avatars/42.png', now()->addMinutes(10), ['ContentType' => 'image/png', 'ContentLength' => 5 * 1024 * 1024],);$upload['url'] is the signed URL and $upload['headers'] holds the Content-Type the upload must use. Without Laravel, build the URL as described in Signed URLs: role upload, with the parameters exp, max_bytes and types.
2. Upload the file
Section titled “2. Upload the file”Send the file with PUT and the same Content-Type:
curl -X PUT \ -H 'Content-Type: image/png' \ --data-binary @avatar.png \ 'https://k3x9q2m7.upload.binedge.net/production/avatars/42.png?exp=...&max_bytes=5242880&types=image%2Fpng&sig=...'A 200 with an empty body means the file is stored. Browsers and apps send the same request directly; your server only signs the URL. For large files or unreliable networks, use resumable uploads.
3. Load it back
Section titled “3. Load it back”Private files need a signed download URL:
$url = Storage::disk('binedge')->temporaryUrl('avatars/42.png', now()->addMinutes(10));Files in a public bucket need no signature and are cached at the edge:
https://k3x9q2m7.edge.binedge.net/production/avatars/42.png- Delivery URLs: how the address of a file is made up.
- Image resizing: serve thumbnails in WebP or AVIF from the same file.