> For the complete documentation index, see [llms.txt](https://doc.ozforensics.com/oz-knowledge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.ozforensics.com/oz-knowledge/other/old-docs/mobile-sdk/ios/uploading-and-analyzing-media.md).

# Uploading and Analyzing Media

{% hint style="info" %}
Please note: this method only works if your SDK version is below 3.0.0. If it is 3.0.0 or newer, please use the methods listed above.
{% endhint %}

#### Server-Based Analyzes

Data to be uploaded and analyzed are stored in object results (see above), obtained after capturing and recording video. Upload it to the server and initiate the necessary analyses with the help of [Oz API](/oz-knowledge/guides/developer-guide/api/oz-api.md).

A simple scenario of interaction with Oz API can be implemented with the `OZSDK.analyse` method as described below.

```objectivec
OZSDK.analyse(
  results: results,
    analyseStates: [.quality],
    fileUploadProgress: { (progress) in

    }
) { (resolution, error) in

}
```

The `completion` | `resolution` block will contain the result of the assigned analysis including status (status of the analysis), type (type of the analysis), and `folderID` (ID of the Oz API folder).

To perform a cross-functional analysis based on video and document photos, use the `OZSDK.documentAnalyse` method:

```objectivec
OZSDK.documentAnalyse(
  documentPhoto: DocumentPhoto(front: frontDocumentURL, back: backDocumentURL),
  results: results,
  scenarioState: { (state) in
  
  }, fileUploadProgress: { (progress) in

  }
) { (folderResolutionStatus, resolutions, error)

}
```

The `completion` | `resolution` block will contain the result of the assigned analysis (similar to `OZSDK.analyse`), where `folderResolutionStatus` is the general status of analyses for the folder.

For both documents and face check, you can use the `OZSDK.uploadAndAnalyse` method:

```
OZSDK.uploadAndAnalyse(results: results,
                    documentPhoto: DocumentPhoto(front: frontDocumentURL, back: backDocumentURL),
                    analysisTypes: [.quality],
                    metadata: nil,
                    scenarioState: { state in },
                    fileUploadProgress: { progress in }) { status, resolution, error in }) 
```

The `resolution` block will contain the result of the assigned analysis (similar to `OZSDK.analyse` and `OZSDK.documentAnalyse`).

#### On-Device Analyzes

The methods below are used to analyze media on the device.

Biometry:

```swift
OZSDK.runOnDeviceBiometryAnalysis(firstResult: firstResult, secondResult: secondResult, completion: { status, error in
//show result
})
```

Liveness:

```swift
OZSDK.runOnDeviceLivenessAnalysis(results: results, completion: {status, error in 
//show result
})
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://doc.ozforensics.com/oz-knowledge/other/old-docs/mobile-sdk/ios/uploading-and-analyzing-media.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
