> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/products/idv-suite/flujos-and-integraciones/configuracion-tecnica-del-cliente/sdk-mobile/android-sdk/componentes-modulos/subida-de-ficheros-y-gestion-de-qr.md).

# File upload and QR management

## Introduction <a href="#id-1-introduccion" id="id-1-introduccion"></a>

Document capture, as well as QR code reading and generation, are handled by the ***CaptureComponent***.

This component lets you upload documents by taking a photo with the device camera or selecting one from the gallery.

***

## Dependency <a href="#id-2-dependencia" id="id-2-dependencia"></a>

The component-specific dependency is:

```
implementation "com.facephi.androidsdk:capture_component:$version"
```

***

## Available controllers <a href="#id-3-controladores-disponibles" id="id-3-controladores-disponibles"></a>

| **Controller**         | **Description**                 |
| ---------------------- | ------------------------------- |
| FileUploaderController | Controller for document capture |

***

## Error handling <a href="#id-6-recepcion-del-resultado" id="id-6-recepcion-del-resultado"></a>

Errors are returned as a CaptureError object.

List of errors:

* CAP\_ACTIVITY\_RESULT\_MSG\_ERROR: The result returned by the activity is incorrect or does not contain the information required to continue.
* CAP\_APPLICATION\_CONTEXT\_ERROR: The required application context is null or invalid, preventing the capture module from being initialized correctly.
* CAP\_CAMERA\_ERROR: An internal error related to the device camera has occurred (opening, initialization, or capture failure).
* CAP\_CAMERA\_PERMISSION\_DENIED: The user denied the permissions required to access the camera.
* CAP\_CANCEL\_BY\_USER: The user manually canceled the capture process.
* CAP\_CANCEL\_LAUNCH: The process was canceled in general by the SDK or by an external action.
* CAP\_COMPONENT\_LICENSE\_ERROR: The component license is invalid, has expired, or does not match the required configuration.
* CAP\_EMPTY\_LICENSE: The license string is empty or has not been provided.
* CAP\_FETCH\_DATA\_ERROR: An error occurred while retrieving or processing the data required to run the flow. *(Includes additional information in the `error`.)*
* CAP\_FLOW\_ERROR: An internal error occurred while running the capture flow. *(Includes additional information in the `error`.)*
* CAP\_INITIALIZATION\_ERROR: An error occurred while initializing the SDK components required. *(Includes detailed information in the `error`.)*
* CAP\_FILE\_UPLOADER\_CAPTURE\_ERROR: An error occurred while uploading the files generated during capture.
* CAP\_IMAGE\_TOO\_LARGE: The image selected from the gallery exceeds the maximum size configured in `maxGalleryImageSizeKb`.
* CAP\_MANAGER\_NOT\_INITIALIZED: The managers required to run the process have not been initialized correctly.
* CAP\_NO\_DATA\_ERROR: The required input data is null, missing, or insufficient to continue the process.
* CAP\_OPERATION\_NOT\_CREATED: An active operation required to continue could not be created or retrieved. *(Includes detailed information in the `error`.)*
* CAP\_QR\_CAPTURE\_ERROR: An error occurred while capturing or reading the QR code.
* CAP\_QR\_GENERATION\_ERROR: An error occurred while generating the requested QR code.
* CAP\_TIMEOUT: The maximum time allowed for one of the process stages has been reached.
* CAP\_FLOW\_VIDEO\_RECORDING\_ERROR: An error occurred during Video Recording within the specified flow.
* CAP\_FLOW\_TRACKING\_ERROR: An error occurred while performing the Tracking required to complete the capture flow.

## Document capture configuration <a href="#id-7-configuracion-de-la-captura-de-documentos" id="id-7-configuracion-de-la-captura-de-documentos"></a>

In `FileUploaderConfigurationData`, along with parameters such as `allowGallery` and `maxScannedDocs`, you can adjust how gallery selection behaves:

* `onlyGalleryMode`: Opens the flow directly in gallery mode, without showing camera capture. By default, `true`.
* `maxGalleryImageSizeKb`: Maximum allowed size, in KB, for images selected from the gallery. By default `2048`. If an image exceeds this limit, the component returns `CAP_IMAGE_TOO_LARGE`.
