# Image upload

This question type is used in cases where you would like the user to take a picture of a document, ID card or themselves.&#x20;

If you would like the responder to be able to upload files as opposed to take images, you can use the [file ](/adding-questions-and-content/question-reference/file-upload.md)content type.  If you would like the responder to sign a document, you can use the [signature ](/adding-questions-and-content/question-reference/signature.md)content type.

{% hint style="info" %}
If you don't want the responder to be held up by an image upload question, make sure to have the question be [optional](/conditions-and-logic.md#optional).
{% endhint %}

### Managing File Storage

By default, Formsort securely stores uploaded files and images with our [data storage service](/saving-and-retrieving-responses.md) — no setup required.\
If you prefer to manage your own storage, you can optionally configure an **S3** or **GCS** bucket as a custom file destination.

To set up a custom integration, follow our detailed guides for:

* [Amazon S3 setup](/integrations/integration-reference/s3.md)
* [Google Cloud Storage setup](/integrations/integration-reference/google-cloud-storage.md)

### Creating a filename pattern

You can opt to define a naming pattern for the images that your responders upload by enabling **Filename pattern** in the question settings.&#x20;

You can [template](/variable-templating.md) any relevant variable you would like to be included in the name of the file into the field. For example, if you type in `{{first_name}}` into the field, the value of the `first_name` variable will be used as the filename at upload.&#x20;

Formsort offers three custom variables for these types of file upload components, built right into the settings of the component itself: `sessionUuid`, `randomUuid`, and `currentTimeUTC`. These variables can also be templated into the filename pattern field to create dynamic filenames.

* `sessionUuid`: a uuid that is created **once**, when the form is loaded.&#x20;
* `randomUuid`: a uuid that is **created at and re-run** at each upload instance.&#x20;
* `currentTimeUTC`:  a timestamp that is **created at and re-run** at each upload instance.&#x20;

<figure><img src="/files/ZiH3oiCIphZZwDRoJQ0k" alt=""><figcaption></figcaption></figure>

You can use several of these variables at once, if required, and one pattern we suggest is `{{currentTimeUTC}}_{{responder_uuid}}`. This ensures uniqueness via the timestamp, while still tying the file to a particular user via the `responder_uuid` System Library variable.&#x20;

{% hint style="info" %}
Visit the [System Library variables](/response-data-collection-and-management/variable-schema/system-library-answers.md) section for details on built-in variables that provide information about the responder's environment and context.&#x20;
{% endhint %}

Note that these extensions will be added automatically. You should also set a fallback naming convention in case the variable is not defined by typing it into the **Filename pattern fallback** field. Values here cannot use templated variables.&#x20;

### Specifying file types allowed

You can whitelist [MIME (Multipurpose Internet Mail Extension) types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types) by adding them to the **Allowed MIME types** field. If none are set, all MIME types will be allowed.&#x20;

{% hint style="info" %}
You should whitelist MIME types when generating signed upload URLs.
{% endhint %}

### Allowing images taken by a camera

By enabling **Allow camera** option in the settings menu with the question selecte&#x64;**,** you can give the responder the option to upload their image by taking a photo on their supported devices. The default camera on mobile devices is the front camera and you can mirror the image taken (depending on whether you expect your subjects to be people or documents) by enabling the **Mirror image?** option.

### **Allowing multiple answers**

Enabling **allow multiple uploads** lets the respondent upload more than one image as an answer to a question.&#x20;

### **Restricting image upload size**

You can enable a size restriction for a responder's upload. The minimum value must be greater than 0. If the restriction is not met, the responder will be shown an error and be prevented from moving forward in the flow.

<div align="left"><figure><img src="/files/yu9FtqVmoSjJKc6aHWuS" alt=""><figcaption></figcaption></figure></div>


---

# 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.formsort.com/adding-questions-and-content/question-reference/image-upload.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.
