Loading pre-existing S3 bucket files into Directus File Library

Hi. Does anyone know if there’s a way, when using S3 as the storage location, to get the File Library to load contents of the S3 Bucket that are already there or have been added outside of Directus?

Any help/advise greatly appreciated!

Thanks

Just so I understand clearly, you’ve got a previous S3 bucket that you’ve connected to Directus. It had files in it already, and you want those files to show up inside the Directus file library? Is that correct?

If that’s the case, then you’ll have to add those files to the database connected to Directus.

If you want them to show up, they have to live inside the directus_files collection in order to display or get served by the Directus API.

That comes with a few challenges because we use the UUID of the file as the file name in the S3 bucket.

So my recommendation would be to re-upload those files to the Directus instance.

If it’s a lot of files you could probably script it fairly easily.