> 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 and QR code reading and generation are performed with the ***CaptureComponent***.

This component allows document upload by taking a photo with the device camera or from the gallery.

***

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

The specific component 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 will be 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 needed 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 has occurred related to the device camera (failure to open, initialize, or capture).
* CAP\_CAMERA\_PERMISSION\_DENIED: The user has denied the permissions required to access the camera.
* CAP\_CANCEL\_BY\_USER: The user has manually canceled the capture process.
* CAP\_CANCEL\_LAUNCH: The process has been generally canceled by the SDK or by an external action.
* CAP\_COMPONENT\_LICENSE\_ERROR: The component license is not valid, 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 obtaining or processing the data needed to execute the Flow. *(Includes additional information in the field `error`.)*
* CAP\_FLOW\_ERROR: An internal error occurred during the execution of the capture Flow. *(Includes additional information in the field `error`.)*
* CAP\_INITIALIZATION\_ERROR: Error initializing the required SDK components. *(Includes detailed information in the field `error`.)*
* CAP\_FILE\_UPLOADER\_CAPTURE\_ERROR: Error during the upload process of the files generated in the 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 execute 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: It was not possible to create or retrieve an active operation needed to continue. *(Includes detailed information in the field `error`.)*
* CAP\_QR\_CAPTURE\_ERROR: Error during QR code capture or reading.
* CAP\_QR\_GENERATION\_ERROR: Error generating the requested QR code.
* CAP\_TIMEOUT: The maximum allowed time has been reached in one of the phases of the process.
* CAP\_FLOW\_VIDEO\_RECORDING\_ERROR: Error during video recording within the established Flow.
* CAP\_FLOW\_TRACKING\_ERROR: Error while performing the Tracking needed 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`, the behavior of gallery selection can be adjusted:

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