Jump to content

Featured Replies

Posted

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?

  • Management

Why would you want to do this?

  • 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.

  • 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.

Look Again Laurence Fishburne GIF by Leroy Patterson

This depth of modification isn't possible with v5.

  • 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.

  • Management

There isn't really a way to overload \IPS\File to do this.

  • Author

ugh... it was so simple to do this with the previous hooks system.

  • Management

But to what end other than a different folder structure? Is it worth the effort?

  • 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.

  • Management

Could you use the API get get the image data?

  • 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 😭

  • Management

V4 had a lot of power. But then we saw what people did with it.

Confused Eyes GIF by MOODMAN

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.

  • 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?

  • 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!

Recently Browsing 0

  • No registered users viewing this page.