# Theme import via file not working

**URL:** https://meta.discourse.org/t/theme-import-via-file-not-working/85472
**Category:** Bug
**Created:** [April 16, 2018, 10:40pm UTC](https://meta.discourse.org/t/theme-import-via-file-not-working/85472 "2018-04-16T22:40:04Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [April 16, 2018, 10:40pm UTC](https://meta.discourse.org/t/theme-import-via-file-not-working/85472/1 "2018-04-16T22:40:04Z")

</div>

I haven’t had to use this in a while, but a need arose today. I tried on two different sites and am unable to import a theme file through the Themes page of the Admin Panel. When I click on the import button and open the file chooser, all the `.dcstyle.json` theme files listed are greyed out.

Not sure if anything here could be related:

> [@Can't upload theme from file](https://meta.discourse.org/t/cant-upload-theme-from-file/73376):
>
> I just tried to import a theme from a file. When I select “from my device” I get the selector and choose the file, but then the “upload” button doesn’t do anything. I tested on two instances Discourse 1.9.0.beta13 and Discourse 1.9.0.beta14. Tested Chome and Firefox on Linux.

Any thoughts?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [April 16, 2018, 10:56pm UTC](https://meta.discourse.org/t/theme-import-via-file-not-working/85472/2 "2018-04-16T22:56:46Z")

</div>

> [@tshenry](#):
>
> When I click on the import button and open the file chooser, all the .dcstyle.json theme files listed are greyed out.

If you file chooser has an Options button, click it, and then select All Files. That should let you upload the file.

---

<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: [April 16, 2018, 10:58pm UTC](https://meta.discourse.org/t/theme-import-via-file-not-working/85472/3 "2018-04-16T22:58:29Z")

</div>

Is this a legit bug or is the UI unclear here?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [April 16, 2018, 11:05pm UTC](https://meta.discourse.org/t/theme-import-via-file-not-working/85472/4 "2018-04-16T23:05:13Z")

</div>

It’s a bug, at least in Chrome and Firefox.

---

<div class="post-metadata">

### Author: ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)
#### Post date: [April 17, 2018, 11:21am UTC](https://meta.discourse.org/t/theme-import-via-file-not-working/85472/7 "2018-04-17T11:21:14Z")

</div>

As a workaround, in OSX you can also drag the file onto the ‘Choose file’ button:

[https://global.discourse-cdn.com/meta/original/3X/6/f/6f96f0fed1f2b4f83a555d82da6a268180555810.mp4](https://global.discourse-cdn.com/meta/original/3X/6/f/6f96f0fed1f2b4f83a555d82da6a268180555810.mp4)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 26, 2018, 4:06am UTC](https://meta.discourse.org/t/theme-import-via-file-not-working/85472/8 "2018-04-26T04:06:48Z")

</div>

This is a weird mac issue. Let’s try this and see how we go:

[https://github.com/discourse/discourse/commit/73688413744ae141690e86f2e1e5395c31d1ba12](https://github.com/discourse/discourse/commit/73688413744ae141690e86f2e1e5395c31d1ba12)

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [April 26, 2018, 6:09am UTC](https://meta.discourse.org/t/theme-import-via-file-not-working/85472/9 "2018-04-26T06:09:36Z")

</div>

I remember trying to fix this with [Data Explorer](https://meta.discourse.org/t/32566?silent=true) too… what’s the `<input>` look like for that?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 26, 2018, 6:17am UTC](https://meta.discourse.org/t/theme-import-via-file-not-working/85472/10 "2018-04-26T06:17:01Z")

</div>

I hacked this in `accept='.dcstyle.json,application/json'` it seems to be ok in my vm

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [April 26, 2018, 6:22am UTC](https://meta.discourse.org/t/theme-import-via-file-not-working/85472/11 "2018-04-26T06:22:58Z")

</div>

Answer:

```
 return ".json,application/json,application/x-javascript,text/json" + (this.get('extension') ? "," + this.get('extension') : "");

```

[https://github.com/discourse/discourse-data-explorer/blob/master/assets/javascripts/discourse/components/json-file-uploader.js.es6#L44-L46](https://github.com/discourse/discourse-data-explorer/blob/master/assets/javascripts/discourse/components/json-file-uploader.js.es6#L44-L46)

I think that allowing `.json` is probably important.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 27, 2018, 8:00am UTC](https://meta.discourse.org/t/theme-import-via-file-not-working/85472/12 "2018-04-27T08:00:09Z")

</div>

This topic was automatically closed after 27 hours. New replies are no longer allowed.
