# 56. Fotos hochladen

Das Hochladen eines Fotos über S3 besteht aus 2 Schritten:

1. **Fordern Sie den vorab signierten Link für den direkten Upload an.**&#x20;

Als Eingabe:&#x20;

* fileExtention - jpeg ODER jpg ODER png,&#x20;
* farmUuid - UUID des Betriebs (Farm),
* fieldUuid - UUID des Feldes,
* noteUuid - UUID der Notiz für den direkten Link des hochgeladenen Fotos,
* commentUuid - UUID des Kommentars für den direkten Link des hochgeladenen Fotos (optional).&#x20;

Als Ausgabe:

* uuid - die erwartete UUID nach dem Upload und der Verarbeitung,
* farmUuid - dieselbe wie die Eingabe,
* fieldUuid - dieselbe wie die Eingabe,
* noteUuid - dieselbe wie die Eingabe,
* commentUuid - dieselbe wie die Eingabe (falls vorhanden),
* s3Url - die URL, die zum Hochladen des Fotos verwendet wird,
* s3Fields - Attribute, die im Formular für den Foto-Upload übergeben werden.

Die Details zur Verwendung von s3Url und s3Fields werden im zweiten Schritt beschrieben.&#x20;

Die Attribute sind nur 60 Minuten gültig, um das Foto hochzuladen.

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

```graphql
mutation generatePresignedPostPhotoData {
  generatePresignedPostPhotoData(input:{
    farmUuid: "89196056-61e5-4bce-b676-d488d611a829" 
    fieldUuid: "586a2ef2-03e4-4715-846c-07a2f0cb3016"
    noteUuid: "4a94da1c-f655-4f17-961a-4b0323e5129c"
    fileExtention: jpeg
    
  } ) {
    uuid
    noteUuid
    fieldUuid
    farmUuid
    s3Url
    s3Fields
  }
}
```

{% endcode %}

2. **Senden Sie ein lokales Foto an s3Url mit vordefinierten Formularattributen aus s3Fields.**

{% 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 %}

Benachrichtigungen über die Verarbeitung werden über den im GraphQL -> Samples -> beschriebenen Subscription-Mechanismus zugestellt. [1. Abonnement: Ereignisse abrufen](/geopard-tutorials/de/api-dokumentation/uberblick-uber-geopard-api-anfragen/1.-subscription-ereignisse-abrufen.md).

{% hint style="info" %}
Verwenden Sie ‚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/de/api-dokumentation/uberblick-uber-geopard-api-anfragen/56.-fotos-hochladen.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.
