# !! Please, change or add new type how Orthanc store data in the storage folder !!

**URL:** https://discourse.orthanc-server.org/t/please-change-or-add-new-type-how-orthanc-store-data-in-the-storage-folder/1944
**Category:** Google Groups archive
**Created:** [May 20, 2020, 9:39am UTC](https://discourse.orthanc-server.org/t/please-change-or-add-new-type-how-orthanc-store-data-in-the-storage-folder/1944 "2020-05-20T09:39:26Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![user19](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/u/3be4f8/32.png) [@user19](https://discourse.orthanc-server.org/u/user19)
#### Post date: [May 20, 2020, 9:39am UTC](https://discourse.orthanc-server.org/t/please-change-or-add-new-type-how-orthanc-store-data-in-the-storage-folder/1944/1 "2020-05-20T09:39:26Z")

</div>

Hi Orthanc team!  
Im glad to use your software. **This is a the best solution** from free open source PACS/DICOM servers that I tested (more than 5).  
I love in Orthanc almost all, except type like an Orthanc store DICOM files in its storage folder. Because of this, I can’t delete, find folder with patient files, or most important for me - create a .bat file, that can backup or delete Dicom files older than few years. **Change the type like Orthanc store Dicom data on hierarchical type** _(in example “ **Year** folder - **Month** folder - **Day** folder - **Patient** folder”)_ help ALL OF US in many ways with using Orthanc server.

**Also** , how to re-index data in storage folder, is it possible now? If not, please add this functionality with hierarchical store type too.  
**This two functions help us (all users of Orthanc!) to resolve many problems with everyday usage of Orthanc Server!**

**All, who also interested in this solution - PLEASE, leave your messages under this topic!**

---

<div class="post-metadata">

### Author: ![jodogne](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/jodogne/32/1511_2.png) [@jodogne](https://discourse.orthanc-server.org/u/jodogne)
#### Post date: [May 20, 2020, 9:51am UTC](https://discourse.orthanc-server.org/t/please-change-or-add-new-type-how-orthanc-store-data-in-the-storage-folder/1944/2 "2020-05-20T09:51:23Z")

</div>

Hello,

Thanks for the positive feedback.

1- Your question regarding the storage area was already answered in the following post:  
[https://groups.google.com/forum/#!msg/orthanc-users/LztwBA7lwAw/qy7iVJxYAwAJ](https://groups.google.com/forum/#!msg/orthanc-users/LztwBA7lwAw/qy7iVJxYAwAJ)

Summarizing, we won’t change the way Orthanc stores its database. This is because Orthanc addresses much more complex workflow than a desktop server that stores DICOM files on its filesystem (think for example about the fact that Orthanc can store its DICOM files into a PostgreSQL database or a AWS S3 bucket).

The “WriteToDisk.lua” script provides a way of emulating your wish.

It is also possible to create a so-called “storage area” plugin through which Orthanc could store the DICOM files similarly to what you describe (but this obviously requires a development effort):  
[https://book.orthanc-server.com/plugins.html](https://book.orthanc-server.com/plugins.html)

2- Regarding your question about re-indexing a storage folder, check out the Orthanc Book (“Direct access to the filesystem” section):  
[https://book.orthanc-server.com/users/replication.html](https://book.orthanc-server.com/users/replication.html)

Sébastien-

---

<div class="post-metadata">

### Author: ![user19](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/u/3be4f8/32.png) [@user19](https://discourse.orthanc-server.org/u/user19)
#### Post date: [May 20, 2020, 10:54am UTC](https://discourse.orthanc-server.org/t/please-change-or-add-new-type-how-orthanc-store-data-in-the-storage-folder/1944/3 "2020-05-20T10:54:19Z")

</div>

Sébastien, many thanks for your answer!  
About “WriteToDisk.lua” script. I found and downloaded script from your post on GitHub. Can you say how install it in Windows and get the result that i needed in the storage folder?  
I already put downloaded script into storage folder “E:\Orthanc-StorageDir” and type path in orthanc.json:  
`

// List of paths to the custom Lua scripts that are to be loaded  
// into this instance of Orthanc  
“LuaScripts” : [  
“E:\Orthanc-StorageDir\WriteToDisk.lua”  
],

`

What next?

---

<div class="post-metadata">

### Author: ![Alain\_Mazy3](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/a/eb9ed0/32.png) [@Alain\_Mazy3](https://discourse.orthanc-server.org/u/Alain_Mazy3)
#### Post date: [May 20, 2020, 12:01pm UTC](https://discourse.orthanc-server.org/t/please-change-or-add-new-type-how-orthanc-store-data-in-the-storage-folder/1944/4 "2020-05-20T12:01:07Z")

</div>

There’s nothing else you need to do beside restarting Orthanc such that it takes into account the new configuration.

---

<div class="post-metadata">

### Author: ![logon38](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/l/839c29/32.png) [@logon38](https://discourse.orthanc-server.org/u/logon38)
#### Post date: [October 24, 2024, 4:33pm UTC](https://discourse.orthanc-server.org/t/please-change-or-add-new-type-how-orthanc-store-data-in-the-storage-folder/1944/5 "2024-10-24T16:33:16Z")

</div>

Hi friends.  
Can you post the script WriteToDisk.lua  
I can’t download it anywhere.

---

<div class="post-metadata">

### Author: ![alainmazy](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/alainmazy/32/1576_2.png) [@alainmazy](https://discourse.orthanc-server.org/u/alainmazy)
#### Post date: [October 28, 2024, 8:38am UTC](https://discourse.orthanc-server.org/t/please-change-or-add-new-type-how-orthanc-store-data-in-the-storage-folder/1944/6 "2024-10-28T08:38:02Z")

</div>

Hi @logon38

[Here it is](https://orthanc.uclouvain.be/hg/orthanc/file/tip/OrthancServer/Resources/Samples/Lua/WriteToDisk.lua).

---

<div class="post-metadata">

### Author: ![logon38](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/l/839c29/32.png) [@logon38](https://discourse.orthanc-server.org/u/logon38)
#### Post date: [November 3, 2024, 3:26pm UTC](https://discourse.orthanc-server.org/t/please-change-or-add-new-type-how-orthanc-store-data-in-the-storage-folder/1944/7 "2024-11-03T15:26:37Z")

</div>

thank you friend!
