# Change storage folder on other sub domain

**URL:** <https://discourse.getcockpit.com/t/change-storage-folder-on-other-sub-domain/957>\
**Category:** General\
**Created:** [August 2, 2019, 9:11am UTC](https://discourse.getcockpit.com/t/change-storage-folder-on-other-sub-domain/957 "2019-08-02T09:11:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![howbizarre](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/howbizarre/32/397_2.png) [@howbizarre](https://discourse.getcockpit.com/u/howbizarre)\
**Post date:** [August 2, 2019, 9:11am UTC](https://discourse.getcockpit.com/t/change-storage-folder-on-other-sub-domain/957/1 "2019-08-02T09:11:22Z")

</div>

Hello,

My Cockpit work on a sub domain and I use Cockpit API to get the information in the site. I want to change storage folder, for some security reason, on other sub domain and all uploads must going there.

I’ve create a defines.php file with `define("COCKPIT_STORAGE_FOLDER", "/home/sub_domain_name/root/assets");`. The folder has 0755 rights.

After uploads defines.php in Cockpit root directory the system immediately return _Error 500_.

Is it possible to change the upload folder in another sub domain?

My site in based on CodeIgniter Web Framework if this has matter.

P.S. Excuse my self for my English…

---

<div class="post-metadata">

**Author:** ![jfzz](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/jfzz/32/360_2.png) [@jfzz](https://discourse.getcockpit.com/u/jfzz)\
**Post date:** [August 2, 2019, 3:11pm UTC](https://discourse.getcockpit.com/t/change-storage-folder-on-other-sub-domain/957/2 "2019-08-02T15:11:00Z")

</div>

I might be wrong, but if you want to save to another subdomain out of your server you should use CloudStorage plugin.

A time ago I asked how to change name files after upload and storage folder location… I hope that helps you.

> [@How to change the asset save format after upload?](https://discourse.getcockpit.com/t/how-to-change-the-asset-save-format-after-upload/874):
>
> When a new image assets is uploaded the default path to the file is format year folder, month folder and day folder. And what if I want to insert all images into only one folder without sub-folder and dates, is there possible? What file should I edit?

---

<div class="post-metadata">

**Author:** ![pauloamgomes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/pauloamgomes/32/48_2.png) [@pauloamgomes](https://discourse.getcockpit.com/u/pauloamgomes)\
**Post date:** [August 2, 2019, 9:29pm UTC](https://discourse.getcockpit.com/t/change-storage-folder-on-other-sub-domain/957/3 "2019-08-02T21:29:39Z")

</div>

Should be possible, you can for example:

Setup a Nginx to serve your static files on [https://assets.yourdomain.com](https://assets.yourdomain.com)  
Make the docroot point to the storage assets folder or create a symlink  
On your website just make sure you prefix the cockpit assets with your hostname.
