# ファイルのアップロード

アップロード済みのファイルを登録し、クラウドフォンにダウンロードさせます。
- **前提条件**：クラウドフォンが起動済みで、他のメンバーに占有されておらず、**その URL にオブジェクトが既に存在していること** — サービスはオブジェクトを検査し、読み取れない場合はリクエストを拒否します。ライブ配信用のアップロードは MP4 でなければならず、配信に対応したデバイスサービスを対象にする必要があります。
- **完了シグナル**：**受理されただけで、完了ではありません。** レスポンスは処理中ステータスの `fileId` を返します。アップロード結果のエンドポイントを、ステータスが成功または失敗になるまでポーリングしてください。
- **リトライ**：重複排除はありません。呼び出しごとに新しい `fileId` が作られます。
- **API 面の補足**：Local API では、このパスは別物である旧来の multipart 方式です。Local API における本エンドポイントの等価物は `/api/cloudphone/upload/file` です。

文書化されたビジネスエラー: `33401`, `33419`。 各コードの意味は [Error Codes](../Getting%20Started/error-codes.md) を参照してください。どの操作でも共通コードが返る場合があります。

Endpoint: POST /cloudphone/uploadFile
Version: 2026-09-05
Security: Authorization

## Security:

  - `Authorization` (unknown)
    http bearer JWT

## Request fields (application/json):

  - `id` (string, required)
    Cloud phone ID
    Example: 1661515884160372

  - `url` (string, required)
    Object URL obtained from `presignedUrl` after the file bytes have been uploaded, or another publicly accessible download URL
    Example: https://storage.example.com/cloudphone/test.jpg

  - `uploadDest` (string, required)
    Upload destination directory
    Example: /Download

  - `uploadType` (integer)
    File type (`1` = regular file, `2` = MP4 live-streaming file)
    Enum: 1, 2

## Response 200:

  - `200` (unknown)
    Success. `data` is an object with the fields `fileId`, `id` and `status`.

## Response 200 fields (application/json):

  - `code` (integer, required)

  - `msg` (string | null, required)

  - `data` (object, required)

  - `data.fileId` (string, required)
    Uploaded file ID

  - `data.id` (string, required)

  - `data.status` (integer, required)
    Upload status 0:uploading 1:success 2:failed

  - `requestId` (string, required)

