V8-archive: How to (easily) get file url

Created on 14 May 2019  路  2Comments  路  Source: directus/v8-archive

I have a collection which contains an image file (well, I appreciate it's just a foreign key for directus_files).

I use axios to read the collection and I get the file id back for each row. It would appear that I then need to iterate over that data to get the file information for each file id. And thus infer the URL. This seems very inefficient.

I assume I'm missing something??

Most helpful comment

Just wanted to add to this:

I've managed to look up those details by getting
/_/items/[collectionname]?filter[whateverfilter]&fields=document.data
then get full_url

N.B. in order for this info to be accessible from Public, you have to adjust your Public Permissions: Files > 'type' must be marked as readable in System Collections

All 2 comments

Ah... ?fields=.

Just wanted to add to this:

I've managed to look up those details by getting
/_/items/[collectionname]?filter[whateverfilter]&fields=document.data
then get full_url

N.B. in order for this info to be accessible from Public, you have to adjust your Public Permissions: Files > 'type' must be marked as readable in System Collections

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rijkvanzanten picture rijkvanzanten  路  3Comments

ondronix picture ondronix  路  3Comments

chintohere picture chintohere  路  3Comments

24js picture 24js  路  3Comments

benhaynes picture benhaynes  路  4Comments