I have a file entity field that I can upload multiple files and I'm trying to render or display it inside my node twig template. The code below is what I'm trying to make it display. Tried clearing my cache but it still shows empty.

I can display the url/uri of a single file upload but I can't seem to figure out how I can display multiple upload files url/uri in the loop.

Single file here:

<a href="{{ file_url(node.field_upload_file.entity.uri.value) }}">Download File</a>

Multiple files Here:

{% for key,value in node.field_upload_file.value %}
  <a href="{{ file_url(node.field_upload_file.entity.uri.value) }}">Download File</a>
{% endfor %}

Is this a way to display multiple upload files url/uri in the loop? Please suggest to me.

1 Answer 1


You can try to loop over the field items:

{% for item in node.field_upload_file %}
  <a href="{{ file_url(item.entity.uri.value) }}">Download File</a>
{% endfor %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.