# Resource Folder

**URL:** <https://forum.inductiveautomation.com/t/resource-folder/82460>\
**Category:** Module Development\
**Created:** [November 29, 2023, 5:41am UTC](https://forum.inductiveautomation.com/t/resource-folder/82460 "2023-11-29T05:41:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_mohamed](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ahmed_mohamed/32/53025_2.png) [@Ahmed\_mohamed](https://forum.inductiveautomation.com/u/Ahmed_mohamed)\
**Post date:** [November 29, 2023, 5:41am UTC](https://forum.inductiveautomation.com/t/resource-folder/82460/1 "2023-11-29T05:41:49Z")

</div>

Hi everyone,  
i'm wondering if i can make a resource folder that will be created when the module is started to be reference to the material

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 29, 2023, 4:07pm UTC](https://forum.inductiveautomation.com/t/resource-folder/82460/2 "2023-11-29T16:07:50Z")

</div>

What kind of resources/what's your ultimate goal?

The recommended pattern is to create a folder in the data directory (`GatewayContext.getSystemManager().getDataDir()`, in the `modules` folder, using your module's ID as the folder name. That folder will be retained in gateway backups (pretty sure) and can be safely used to store arbitrary resources.

---

<div class="post-metadata">

**Author:** ![Ahmed\_mohamed](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ahmed_mohamed/32/53025_2.png) [@Ahmed\_mohamed](https://forum.inductiveautomation.com/u/Ahmed_mohamed)\
**Post date:** [December 3, 2023, 8:40pm UTC](https://forum.inductiveautomation.com/t/resource-folder/82460/3 "2023-12-03T20:40:36Z")

</div>

I apologize for my delayed response; I appreciate your understanding.  
I want to create a dedicated folder to store resources, such as images, for use in a Perspective component. For example, I would like to reference an image like this

> /IgnitionProject  
> └──  
> ├── Resources  
> │ └── img.png  
> ├── anotherFolder  
> │ └── file.txt  
> └── ...

`<img src="/system/Resources/img.png" alt="Image" />`

---

<div class="post-metadata">

**Author:** ![weixionglichina](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/weixionglichina/32/10650_2.png) [@weixionglichina](https://forum.inductiveautomation.com/u/weixionglichina)\
**Post date:** [December 4, 2023, 3:44am UTC](https://forum.inductiveautomation.com/t/resource-folder/82460/4 "2023-12-04T03:44:20Z")

</div>

Webdev module is not free module though, I suggest you to add a blob server by creating a module, that is how we did.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 4, 2023, 4:01am UTC](https://forum.inductiveautomation.com/t/resource-folder/82460/5 "2023-12-04T04:01:07Z")

</div>

This is the module development category, so module-based solutions are implied. Any module can register a servlet class to offer arbitrary resources to web clients.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 4, 2023, 4:33am UTC](https://forum.inductiveautomation.com/t/resource-folder/82460/6 "2023-12-04T04:33:02Z")

</div>

You don't even have to set up the servlet yourself.

Implement [`getMountedResourceFolder`](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.34/com/inductiveautomation/ignition/gateway/model/GatewayModuleHook.html#getMountedResourceFolder()) on your `GatewayModuleHook` and we'll automatically serve requests to a specific root URL path to a resource folder inside your module jar(s) in the appropriate scope.
