How to check if the file is uploaded

Hi everyone,

I want to check if file is uploaded to camunda or not.
If $check is true, admin can download the file,
else $check is false and the process ends.
image
Everytime I run the process I get $check=“true” and I don’t know how to actually check if the file exists. When I go to cockpit I can see that in the field “photoUpload” I can dowload this file:
image

Here is my code ( I guess it’s way to simple):
image

@pauline did you uploaded the file in user task?

Thank you for your reply once again :blush:
Here is my task, where I put my file:

The issue is that file upload field is not required to fill and I have to check later if the file was uploaded or not. I don’t get errors, but the logic of my code is wrong and I don’t know how to solve this problem :confused:

Hi @pauline,

  1. Can you show the code of the form that you created for this user task?
  2. Can you show the code of the part where you are actually uploading your file?

Regards
Michael

  1. The form, where I upload file:
    image
    image
    image
  2. The form, where I download file:
    image

And the code where I check if the file is uploaded is in my first post.

Thank you so much for your time :slight_smile: