# Custom assets upload folder?

**URL:** https://meta.discourse.org/t/custom-assets-upload-folder/89732
**Category:** Support
**Created:** [June 13, 2018, 4:26am UTC](https://meta.discourse.org/t/custom-assets-upload-folder/89732 "2018-06-13T04:26:17Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![helmi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/helmi/32/114772_2.png) [@helmi](https://meta.discourse.org/u/helmi)
#### Post date: [June 13, 2018, 4:26am UTC](https://meta.discourse.org/t/custom-assets-upload-folder/89732/1 "2018-06-13T04:26:17Z")

</div>

Is there any default configuration to upload custom assets into the shared folder for web accessible assets like fonts?

It’s a bit weird to allow all the web font formats for uploads into the forum just to add them as assets. I thought there should be some folder in `/var/discourse/shared` for that.

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [June 13, 2018, 4:32am UTC](https://meta.discourse.org/t/custom-assets-upload-folder/89732/2 "2018-06-13T04:32:18Z")

</div>

Search for `authorized_extensions` in the admin settings.

You have total control over what extensions to allow as you see fit:

 ![Capture](https://global.discourse-cdn.com/meta/original/3X/6/f/6f0961277c07db7d9faa582d688cebcdc24f83db.PNG)

---

<div class="post-metadata">

### Author: ![helmi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/helmi/32/114772_2.png) [@helmi](https://meta.discourse.org/u/helmi)
#### Post date: [June 13, 2018, 4:46am UTC](https://meta.discourse.org/t/custom-assets-upload-folder/89732/3 "2018-06-13T04:46:05Z")

</div>

sure, I was just thinking there should be a better way to upload a bunch off assets to the forum. Doing it that way is a bit of a hazzle as it renames every file on upload and it sounds a bit weird to activate all the file formats for upload that I wouldn’t allow my users to upload usually.

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [June 13, 2018, 4:57am UTC](https://meta.discourse.org/t/custom-assets-upload-folder/89732/4 "2018-06-13T04:57:39Z")

</div>

The only setting that would affect all users is the second one. Allowing `svg` uploads for staff or in themes does not mean that all users will be able to upload `svg` files.

I’m still unsure what your use case is. Can you share a bit more on what you’re trying to do?

---

<div class="post-metadata">

### Author: ![helmi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/helmi/32/114772_2.png) [@helmi](https://meta.discourse.org/u/helmi)
#### Post date: [June 13, 2018, 5:06am UTC](https://meta.discourse.org/t/custom-assets-upload-folder/89732/5 "2018-06-13T05:06:42Z")

</div>

Well maybe I’m just getting it wrong? I’d like to upload a bunch (24) font files to be used in my theme. I would prefer to just upload them via sftp to a folder instead of uploading them in the forums. The way assets are uploaded to the assets topic in staff forum renames them and I need to wildly encrypt the css file for fonts instead of having clear naming. Also I need to add the fonts to “authorized extensions” that way.

I’m not sure how the ‘theme authorized extensions’ work - but maybe that’s the way it should go - where are these theme uploads?

EDIT: just ignore me - I really should have opened my eyes first :-/

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 13, 2018, 5:08am UTC](https://meta.discourse.org/t/custom-assets-upload-folder/89732/6 "2018-06-13T05:08:27Z")

</div>

Ok so this topic can be removed then?

---

<div class="post-metadata">

### Author: ![helmi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/helmi/32/114772_2.png) [@helmi](https://meta.discourse.org/u/helmi)
#### Post date: [June 13, 2018, 5:13am UTC](https://meta.discourse.org/t/custom-assets-upload-folder/89732/7 "2018-06-13T05:13:44Z")

</div>

well yeah I guess this is the way to do it then - it’s still a bit more awkward than I was hoping for but it looks like there’s no easy way to just put static assets in a folder.

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [June 13, 2018, 5:22am UTC](https://meta.discourse.org/t/custom-assets-upload-folder/89732/8 "2018-06-13T05:22:44Z")

</div>

When you upload theme assets you can assign variables to them.

You can then use the variables to call them like so (in the case of fonts)

```plaintext
@font-face {
  font-family: 'font';
  src: url(#{$fontWoff2}) format('woff2');
}

.foo {
  font-family: 'font';
}

```

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [June 13, 2018, 5:26am UTC](https://meta.discourse.org/t/custom-assets-upload-folder/89732/9 "2018-06-13T05:26:59Z")

</div>

Also, if you develop a theme using a git repo, you can put all your assets in an /assets folder. But you still have to assign variables for them in `about.json`

More details here:

> [@Structure of themes and theme components](https://meta.discourse.org/t/how-to-develop-custom-themes/60848):
>
> Discourse supports [native themes](https://meta.discourse.org/t/native-theme-support/47494/26) that can be sourced from a .tar.gz archive or from a remote git repository including [private repositories](https://meta.discourse.org/t/how-to-source-a-theme-from-a-private-git-repository/82584). An example theme is at: [GitHub - discourse/discourse-simple-theme: Sam's simple discourse theme · GitHub](https://github.com/SamSaffron/discourse-simple-theme) The git repository will be checked for updates ([once a day](https://github.com/discourse/discourse/blob/main/app/jobs/scheduled/check_out_of_date_themes.rb)), or by using the Check for Updates button. When changes are detected the Check for Updates button will change to the Update to Latest. [image] To create a theme you need to foll…

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 13, 2018, 5:33am UTC](https://meta.discourse.org/t/custom-assets-upload-folder/89732/10 "2018-06-13T05:33:19Z")

</div>

Yes, put them in a folder in an external webserver (or shared webfonts from a proper CDN). Problem solved.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [July 13, 2018, 5:33am UTC](https://meta.discourse.org/t/custom-assets-upload-folder/89732/11 "2018-07-13T05:33:20Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
