# uploadPieceStreaming

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

Defined in: [packages/synapse-core/src/sp.ts:466](https://github.com/FilOzone/synapse-sdk/blob/32f86959b0bf15557657ea412e31a0897440ca98/packages/synapse-core/src/sp.ts#L466)

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