Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted February 17Feb 17 I'm building an extension that allows me to save the pictures of each album in a specific folder. In my previous application, I used to make a hook on Ips\file for the getClass function and check if $storageExtension was for the gallery. If it was, I would replace the container with my custom path. What would be the best way to achieve this override?
February 17Feb 17 Author Because I like to store my files in a more organized way, each album becomes a folder inside a category folder, and so on, instead of having thousands of pictures dumped into the "uploads" folder without meaning lol.
February 17Feb 17 Management Wait until you try S3.In all seriousness, let the file system do its thing. It's all 1s and 0s, directory structures are an illusion.This depth of modification isn't possible with v5.
February 17Feb 17 Author That's why I developed my own application. I'm just trying to migrate it using the new listeners / extensions system but I can't find the right solution.
February 17Feb 17 Management But to what end other than a different folder structure? Is it worth the effort?
February 17Feb 17 Author Yes! The folder where I store my pictures is connected to another internal application that needs this tree-structure to work properly. Also if I need to locate 1 picture specifically from the server I don't have to scroll trough thousands of files with random names all the time.
February 17Feb 17 Author The "parser" is on the same server as InVision. Calling the API multiple times to recreate the tree structure seems a bit excessive to me compared to simply adding the two lines of code I had back in V4 😭
February 17Feb 17 Management V4 had a lot of power. But then we saw what people did with it. If you want to tell me more about your needs, even in a PM if you don’t want to go public with it, I’m sure there’s a way forward.
February 17Feb 17 Author I don’t find it hard to imagine worse things than moving files in a directory haha!Back to the original question, though. As a workaround, is there a way to move the files after they are created? Maybe with a listener on the Image node?
February 17Feb 17 Author 14 minutes ago, Matt said:If you want to tell me more about your needs, even in a PM if you don’t want to go public with it, I’m sure there’s a way forward.Sure! Even though that’s pretty much it haha!