Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions blob/reference/types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,6 @@ A direct browser upload makes up to four kinds of request to your upload route.
| `end` | Once the bytes landed | Completes the upload, runs `onUploadComplete`. Retried by the browser on failure. |
| `cancel` | On `cancel()` | Aborts the multipart upload, or deletes the single-PUT object. |

Every request and every successful answer carries `protocol`, the version of this exchange, in the JSON body. It is separate from the package version, so a browser bundle and a server on different SDK releases still understand each other. A missing value means `1`, changes are only ever additive, and neither side refuses the other's version.

The PUTs that carry the bytes go to storage, never to your route. [How signing works](/blob/reference/signing#the-direct-upload-handshake) has the full handshake.
2 changes: 1 addition & 1 deletion blob/uploads/constraints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ onBeforeUpload: async ({ request, file }) => {
## In the browser

```json
{ "constraints": { "contentTypes": ["image/png"], "maxSize": 2000000 } }
{ "protocol": 1, "constraints": { "contentTypes": ["image/png"], "maxSize": 2000000 } }
```

`GET` on the upload route serves the constraints it enforces, cached for 60 seconds, so a deploy that changes a route's limits reaches clients within a minute.
Expand Down
4 changes: 3 additions & 1 deletion llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3472,6 +3472,8 @@ A direct browser upload makes up to four kinds of request to your upload route.
| `end` | Once the bytes landed | Completes the upload, runs `onUploadComplete`. Retried by the browser on failure. |
| `cancel` | On `cancel()` | Aborts the multipart upload, or deletes the single-PUT object. |

Every request and every successful answer carries `protocol`, the version of this exchange, in the JSON body. It is separate from the package version, so a browser bundle and a server on different SDK releases still understand each other. A missing value means `1`, changes are only ever additive, and neither side refuses the other's version.

The PUTs that carry the bytes go to storage, never to your route. [How signing works](/docs/blob/reference/signing#the-direct-upload-handshake) has the full handshake.

# Abandoned Uploads
Expand Down Expand Up @@ -3785,7 +3787,7 @@ onBeforeUpload: async ({ request, file }) => {
## In the browser

```json
{ "constraints": { "contentTypes": ["image/png"], "maxSize": 2000000 } }
{ "protocol": 1, "constraints": { "contentTypes": ["image/png"], "maxSize": 2000000 } }
```

`GET` on the upload route serves the constraints it enforces, cached for 60 seconds, so a deploy that changes a route's limits reaches clients within a minute.
Expand Down