# Is there a way to create a folder structure for uploaded images in the e-mail builder?

**URL:** <https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569>\
**Category:** Product Support\
**Created:** [October 7, 2023, 11:34am UTC](https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569 "2023-10-07T11:34:16Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefan-franz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stefan-franz/32/12758_2.png) [@stefan-franz](https://forum.mautic.org/u/stefan-franz)\
**Post date:** [October 7, 2023, 11:34am UTC](https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569/1 "2023-10-07T11:34:16Z")

</div>

**Your software**  
My Mautic version is: 4.4.10  
My PHP version is: 8.0.30  
My Database type and version is: 10.6

Is there a way to create a folder structure for uploaded images in the e-mail builder?  
I would like to sort the pictures into a folder structure so that they can be found more easily later. Is there any way to do it?

---

<div class="post-metadata">

**Author:** ![ricfreire](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ricfreire/32/14973_2.png) [@ricfreire](https://forum.mautic.org/u/ricfreire)\
**Post date:** [October 10, 2023, 4:24pm UTC](https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569/2 "2023-10-10T16:24:13Z")

</div>

Hi @stefan-franz,

I’ve also tried to find a solution to this issue because the library can become messy over time. Unfortunately, I haven’t come across a solution as well. 😦

Best regards,  
Ricardo

---

<div class="post-metadata">

**Author:** ![Leon\_Oltmanns](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/leon_oltmanns/32/10629_2.png) [@Leon\_Oltmanns](https://forum.mautic.org/u/Leon_Oltmanns)\
**Post date:** [October 11, 2023, 6:16am UTC](https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569/3 "2023-10-11T06:16:20Z")

</div>

Hi @stefan-franz,  
the closest to a folder structure we currently have is the “elfinder”, Mautics media manager. You can open it by adding “/elfinder” to the URL of your Mautic instance, for Example [www.mymautic.com/elfinder](http://www.mymautic.com/elfinder).

There you can create folders, structure your uploads and delete older images.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/1/10843c4f1c4b8e928a9ca3bbf7db8d7511bcaa14.png)

But, as far as I know, having a structure made in the elfinder, has no impact on the image-block in the email-builder. The image selector still seems a bit messy.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/1/115d43594ec93c936624215acd4e539078f89dea.png)

Best  
Leon

---

<div class="post-metadata">

**Author:** ![stefan-franz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stefan-franz/32/12758_2.png) [@stefan-franz](https://forum.mautic.org/u/stefan-franz)\
**Post date:** [October 11, 2023, 7:24am UTC](https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569/4 "2023-10-11T07:24:37Z")

</div>

Can’t access to it.

![Elfinder Answer](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/55d8538579c5ca651757b8ba73843420dd6557f0.png)

---

<div class="post-metadata">

**Author:** ![Leon\_Oltmanns](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/leon_oltmanns/32/10629_2.png) [@Leon\_Oltmanns](https://forum.mautic.org/u/Leon_Oltmanns)\
**Post date:** [October 11, 2023, 7:40am UTC](https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569/5 "2023-10-11T07:40:50Z")

</div>

Hi @stefan-franz,  
is there a corresponding log-entry?

First very wild guess would be to check wether you have CORS-Settings activated. “Settings” → “System Settings” → “CORS” and disable if not already disabled.

Best  
Leon

---

<div class="post-metadata">

**Author:** ![stefan-franz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stefan-franz/32/12758_2.png) [@stefan-franz](https://forum.mautic.org/u/stefan-franz)\
**Post date:** [October 11, 2023, 8:03am UTC](https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569/6 "2023-10-11T08:03:17Z")

</div>

Cors disable has no effect.  
But no problem: I’ll wait until we have a stable V5.  
Thanks, Stefan

---

<div class="post-metadata">

**Author:** ![Leon\_Oltmanns](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/leon_oltmanns/32/10629_2.png) [@Leon\_Oltmanns](https://forum.mautic.org/u/Leon_Oltmanns)\
**Post date:** [October 11, 2023, 3:18pm UTC](https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569/7 "2023-10-11T15:18:31Z")

</div>

Hi @stefan-franz,  
just because Im very curious. Do you have commandline-access and can fire the `"php bin/console elfinder:install"` Command and check again if you can access the ElFinder?

Best  
Leon

---

<div class="post-metadata">

**Author:** ![alexhammer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexhammer/32/14525_2.png) [@alexhammer](https://forum.mautic.org/u/alexhammer)\
**Post date:** [April 5, 2024, 7:18am UTC](https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569/8 "2024-04-05T07:18:53Z")

</div>

you can add this to the end of you local.php file:

```auto
if (!defined('ELFINDER_IMAGEMAGICK_PS')) {
    define('ELFINDER_IMAGEMAGICK_PS', '/usr/bin/convert');
}

```

then you can access your ELFINDER again

---

<div class="post-metadata">

**Author:** ![stefan-franz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stefan-franz/32/12758_2.png) [@stefan-franz](https://forum.mautic.org/u/stefan-franz)\
**Post date:** [April 12, 2024, 8:30am UTC](https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569/9 "2024-04-12T08:30:58Z")

</div>

Hmmm…don’t know if you did understood me right…and how about 5.0.4 - let me ask again (i’m a newbie, so please explain it for dummies 😉

Now i use Mautic 5.0.4 - and it looks the same as in 4.4.10

 ![Attachments Mautic](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/9c3775ef26a9308bd3562bd54dced2df1f3b74f4.png)

My question: I’d like to have the possibility for subdirectorys like on a normal laptop - here e.g. subdirectory “persons” “products” “business” and so on.

1. Is that possible
2. if yes, how can i do it? What is elfinder?

@alexhammer  
What file (in which directory) do you mean?  
Does it work with 5.0.4?

---

<div class="post-metadata">

**Author:** ![alexhammer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexhammer/32/14525_2.png) [@alexhammer](https://forum.mautic.org/u/alexhammer)\
**Post date:** [April 18, 2024, 9:07am UTC](https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569/10 "2024-04-18T09:07:00Z")

</div>

the local.php file is where most of mautic setup data is stored.  
it is in here: your/path/to/mautic/app/config/local.php

---

<div class="post-metadata">

**Author:** ![stefan-franz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stefan-franz/32/12758_2.png) [@stefan-franz](https://forum.mautic.org/u/stefan-franz)\
**Post date:** [April 18, 2024, 11:19am UTC](https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569/11 "2024-04-18T11:19:39Z")

</div>

I added you lines to the local.php  
It was in /var/www/html/mautic/config/

```auto
        'saml_idp_entity_id' => 'https://infxxxxxxxxxx',
);
if (!defined('ELFINDER_IMAGEMAGICK_PS')) {
    define('ELFINDER_IMAGEMAGICK_PS', '/usr/bin/convert');
}

```

If i want to use it, linktoMautic/elfinder  
then only a white screen comes. May the access works, but no directory or files are shown.

---

<div class="post-metadata">

**Author:** ![stefan-franz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stefan-franz/32/12758_2.png) [@stefan-franz](https://forum.mautic.org/u/stefan-franz)\
**Post date:** [April 18, 2024, 11:25am UTC](https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569/12 "2024-04-18T11:25:35Z")

</div>

But i tested the e-mail image requester. Here is no subdirectory viewable. So elfinder makes no sense. Hope that the file window gets in the future a file manager to manage subdirectorys.

---

<div class="post-metadata">

**Author:** ![marcus42](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@marcus42](https://forum.mautic.org/u/marcus42)\
**Post date:** [April 19, 2024, 10:41am UTC](https://forum.mautic.org/t/is-there-a-way-to-create-a-folder-structure-for-uploaded-images-in-the-e-mail-builder/29569/13 "2024-04-19T10:41:19Z")

</div>

You probably want to revisit the idea of building a media library on your Mautic install.

I have no doubt that the server stack can handle it. But asking that to as JS script? That’s a bit of wishful thinking - wrong tool for the wrong job (try it with few 100k media and let me know how it went. But my prediction will be much dark if you ask me).

Actually you may want to avoid as much as possible to store medias on your Mautic server. Leave that part to a third party like a CDN or an actual web server.

Mautic will act as a proxy where to get the origin, you need to request it to mautic. And then mautic will do a redirect to the origin. Super light weight server side (Apache can easily take care of hundreds if not thousands of concurrent requests. But probably not your hard drives)

This will keep your Mautic install clean, more secure, much lighter. And you’ll still be tracking email open rates and stuff while also sharing that info with the CDN/web server (double win).

Last bit;  
The elfinder gui is used for other purpose. And not intended to be use with Grapjs Please see in the components for example.

Hope that it will help in your journey.
