# How Can I Check If a File Has Been Uploaded?

**URL:** <https://community.replicated.com/t/how-can-i-check-if-a-file-has-been-uploaded/669>\
**Category:** Packaging an application\
**Tags:** vendor, kots, config, templating\
**Created:** [January 18, 2022, 2:19pm UTC](https://community.replicated.com/t/how-can-i-check-if-a-file-has-been-uploaded/669 "2022-01-18T14:19:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fernando\_Cremer](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.replicated.com/fernando_cremer/32/436_2.png) [@Fernando\_Cremer](https://community.replicated.com/u/Fernando_Cremer)\
**Post date:** [January 18, 2022, 2:19pm UTC](https://community.replicated.com/t/how-can-i-check-if-a-file-has-been-uploaded/669/1 "2022-01-18T14:19:29Z")

</div>

One of the field types available in KOTS’ [Config](https://kots.io/reference/v1beta1/config/) Kind is a `file`. This allows the end user to upload the file, and the application is able to consume the contents via our [templating](https://kots.io/reference/template-functions/config-context/).

But, what if you want to check if the file is there at all? In that case you can use the `eq` operator to check the file against an empty string. In the example below, a label is displayed when a file is not uploaded:

```auto
apiVersion: kots.io/v1beta1
kind: Config
metadata:
  name: config-sample
spec:
  groups:
    - name: example_settings
      title: My Example Config
      description: Configuration example to show the file config
      items:
        - name: file
          title: Upload File
          help_text: upload a file
          type: file
        - name: label
          type: label
          title: File Not Uploaded
          when: repl{{ eq (ConfigOption "file") "" }}

```

Below is the screenshots of the rendered page when there is no file uploaded:

 ![Screen Shot 2022-01-18 at 9.18.15 AM](https://canada1.discourse-cdn.com/flex030/uploads/replicated/original/1X/bdb25e8b9f766f530fb018232d2d219c6f93f924.png)

Below is the screenshot of the rendered page when the file has been uploaded:

 ![Screen Shot 2022-01-18 at 8.38.27 AM](https://canada1.discourse-cdn.com/flex030/uploads/replicated/original/1X/06600ec0742bd26fea0fbc5d8af9194418aced90.png)
