# Read a temporary connector file stream

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Read stored file bytes using a temporary connector file ID.

```text
GET https://api.moi.matrixorigin.cn/v5/connectors/file/stream
```

## Before you call this API

Set `BASE_URL` to the product API prefix `https://api.moi.matrixorigin.cn/v5`. For private deployments, use the corresponding product API URL.

Prepare product credential MOI_KEY and WORKSPACE_ID in the same environment. BASE_URL includes the product prefix. Obtain all IDs from actual query results; example data illustrates structure only.

## Request parameters

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl --fail-with-body -sS "$BASE_URL/connectors/file/stream?conn_file_id=$CONN_FILE_ID" \
  -H "X-API-Key: $MOI_KEY" -H "X-Workspace-ID: $WORKSPACE_ID" \
  -o "$OUTPUT_FILE"
```

:::::
:::::{tab-item} Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `conn_file_id` | string | Yes | Query parameter from temporary-file upload/preview or download-URL responses. |

Requires product identity and Workspace in the same environment. Download URLs are relative paths; retain the actual complete returned path and query parameters. These are not signed single-file capability links. Content-Type is application/octet-stream; the attachment name comes from the persisted temporary file name.

:::::
::::::
:::::::

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```text
HTTP/1.1 200 OK
<binary file content>
```

:::::
:::::{tab-item} Fields

| Field/response item | Type | Description |
| --- | --- | --- |
| `响应体` | bytes (byte stream) | Read to completion and close the stream. Do not treat partial content after an error as a complete file. |

Successful responses have no uniform code/data wrapper; temporary files and image streams return bytes directly.

:::::
::::::
:::::::

## Error responses

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "ErrNotFound",
  "msg": "示例本地化错误"
}
```

:::::
:::::{tab-item} Fields

| HTTP | code/format | Condition |
| --- | --- | --- |
| 400 | No response body | Missing conn_file_id query parameter. |
| 404 | ErrNotFound | Temporary record or underlying object missing. |
| 403 | ErrForbidden | Permission denied. |
| 503 | ErrServiceUnavailable | Other temporary-file dependencies unavailable. |

Outer identity/task-proof rejection may precede this handler. Retain raw HTTP, machine codes, and actual diagnostics; do not apply other file-protocol error envelopes.

:::::
::::::
:::::::
