Did you considered using an attribute, which value is a URL to fetch the file? That’s how I usually address such use cases. E.g. you may have a file
resource, which has a downloadUrl
attribute additionally to name
, createdAt
, updatedAt
and similar attributes.
You may also want to have a look at this question, which seems to be similar.