Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

API returns null for files

Tags:

php

directus

I'm using Directus for a headless CMS. I have been uploading a file through the Directus App but the API returns null for the file field.

How can I fix this issue?

like image 604
yuku Avatar asked May 06 '26 13:05

yuku


2 Answers

If you are running the latest version of Directus, apparently there is a bug that completely blows up the File field. The files get uploaded but it doesn't get linked to the field.

https://github.com/directus/api/issues/1015

It should be fixed in the next build.

like image 67
Lazar Avatar answered May 08 '26 04:05

Lazar


(I can't comment due to reputation)

Are you ensuring this is an authenticated call, if you would like to make this a public call so anyone can access it (IE: A website frontend), then you might want to allow public READ access to directus_files.

like image 45
Shea Lavington Avatar answered May 08 '26 03:05

Shea Lavington



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!