# 55. zipファイルをアップロード（6 MB超）

AWS クラウドプロバイダーの技術的制約として、6MB を超えるファイルのアップロードは2段階で行う必要があります：

#### **1. さらに直接アップロードするための事前署名付きリンクをリクエストします。**  <a href="#step1" id="step1"></a>

入力として：&#x20;

* `fileType（ファイルタイプ）` - `収量` または `土壌` または `施用された` または `adapt` または `境界`,&#x20;
* `farmUuid` （オプション） - ファイルをインポートする農場の UUID。&#x20;

出力として：

* `uuid` - アップロードおよび処理後に予想される UUID、
* `farmUuid` - 入力と同じ、
* `fileType（ファイルタイプ）` - 入力と同じ、
* `s3Url（S3 の URL）` - ファイルをアップロードするために使用する URL、
* `s3Fields（S3 フォームフィールド）` - アップロード用フォームに渡す属性。

の使用方法の詳細は `s3Url（S3 の URL）` と `s3Fields（S3 フォームフィールド）` 2 番目のステップに記載されています。&#x20;

これらの属性はファイルのアップロードに対してのみ 60 分間有効です。

{% code overflow="wrap" lineNumbers="true" %}

```graphql
mutation GeneratePresignedPostFileData {
  generatePresignedPostFileData(input:{
    fileType: applied
    farmUuid: "8bba5132-3a92-4ce1-8699-220e78ad68bd"
  } ) {
    uuid
    farmUuid
    fileType（ファイルタイプ）
    s3Url（S3 の URL）
    s3Fields（S3 フォームフィールド）
  }
}

```

{% endcode %}

#### **2. s3Fields からの事前定義されたフォーム属性を使用して、ローカルファイルを s3Url に送信します。**  <a href="#step2" id="step2"></a>

{% code overflow="wrap" lineNumbers="true" %}

```bash
curl --location --request POST '<s3Url>' \
--form 'key="<value_in_s3Fields>"' \
--form 'AWSAccessKeyId="<value_in_s3Fields>"' \
--form 'x-amz-security-token="<value_in_s3Fields>"' \
--form 'policy="<value_in_s3Fields>"' \
--form 'signature="<value_in_s3Fields>"' \
--form 'file=@"<local_file_path>"'
```

{% endcode %}

処理に関する通知は、で説明されているサブスクリプション機構を介して配信されます。\
&#x20;[1. サブスクリプション：イベントを取得する](/geopard-tutorials/jpn/apidokyumento/geopard-apirikuesuto/1-sabusukuripushon-ibentowo.md).

{% hint style="info" %}
レスポンスヘッダーには `Etag（エタグ）` ヘッダーが含まれており、例えば次のように表示されます `Etag: "6fd3e76992738357ab50039f2c60024e"`。この値はその後 GraphQL で使用されます [query getPlatformContext](/geopard-tutorials/jpn/apidokyumento/geopard-apirikuesuto/83-kueri-purattofmukontekisutowo.md) 処理の進行状況の監視や「Field」「AsAppliedDataset」「YieldDataset」「SoilDataset」エンティティとの関連付けのために。
{% endhint %}

{% hint style="info" %}
を使って `‘Accept-Encoding’:’gzip, deflate, br’`.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.geopard.tech/geopard-tutorials/jpn/apidokyumento/geopard-apirikuesuto/55-zipfairuwoappurdo6-mb.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
