#Storing files in subfolders inside storage container upon upload

2 messages · Page 1 of 1 (latest)

hidden kernel
#

I really want to store my files in subfolders on my storage container (s3) so that they are not all sitting in the base directory of the bucket. I'm coming from drupal where we were able to use {{ variables }} to add a subfolder to the image location, and this was quite useful.

So now I'm tasked with the difficulty of figuring out how to a) import the data into directus or b) write a script to COPY the file from it's existing location to the directus' storage method - which is what I think might make most sense so that I get all the special formatting that comes along with it in the metadata.

But when I do this I'm going to wind up with all the files on the root, instead of the nice NodeID/Filename, NodeID/Filename formatting.

So the question is does directus even support subfolders inside the storage container at all??? Would the filename_disk be possible to have a subfolder like nodeid/filename.jpg at all?

How would someone go about writing an "Advanced file manager" extension inside directus, does it exist? Does someone want some consulting work to make this for me? (lol)

The features I need are.

  1. import files from an existing s3 bucket, that are located in a subfolder based on nodeID (I have the export from drupal so I have all the data necessary in a csv).
  2. upon uploading of a file from a content item, store the files in a subfolder on the container based on the "content id" or similar field.

Directus is awesome so far! Thanks for everyone's contributions to the community and code. I apprecaite any input on how to manage a large amount of images successfully.

reef nimbusBOT
#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please help us help you making sure you:

  • Adding an explanation of exactly what you're trying to achieve.
  • Adding any and all related code or previous attempts.
  • Describing the exact issue or error you are facing.
  • Posting any screenshots if applicable.
  • Reading through https://stackoverflow.com/help/how-to-ask.

When you're done with this thread, please close it. Thanks! ✨

(If you have a support agreement and need help, please contact the core team via email.)