# uploadPieceStreaming

```ts
function uploadPieceStreaming(options): Promise<UploadPieceResponse>;
```

Defined in: [packages/synapse-core/src/sp.ts:451](https://github.com/FilOzone/synapse-sdk/blob/1d6c4b9fe34534bf1087dfe41491b72be0b46858/packages/synapse-core/src/sp.ts#L451)

Upload piece data using the 3-step CommP-last streaming protocol.

Protocol:
1. POST /pdp/piece/uploads → get upload session UUID
2. PUT /pdp/piece/uploads/{uuid} → stream data while calculating CommP
3. POST /pdp/piece/uploads/{uuid} → finalize with calculated CommP

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `options` | [`UploadPieceStreamingOptions`](/reference/filoz/synapse-core/sp/type-aliases/uploadpiecestreamingoptions/) | Upload options |

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UploadPieceResponse`](/reference/filoz/synapse-core/sp/type-aliases/uploadpieceresponse/)\>

PieceCID and size of uploaded data

## Throws

Error if upload fails at any step or if size exceeds MAX_UPLOAD_SIZE