# Ghost says invalid ZIP when upload my theme

**URL:** <https://forum.ghost.org/t/ghost-says-invalid-zip-when-upload-my-theme/4001>\
**Category:** Developer help\
**Created:** [November 12, 2018, 2:20pm UTC](https://forum.ghost.org/t/ghost-says-invalid-zip-when-upload-my-theme/4001 "2018-11-12T14:20:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vasanthdeveloper](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vasanthdeveloper/32/5227_2.png) [@vasanthdeveloper](https://forum.ghost.org/u/vasanthdeveloper)\
**Post date:** [November 12, 2018, 2:20pm UTC](https://forum.ghost.org/t/ghost-says-invalid-zip-when-upload-my-theme/4001/1 "2018-11-12T14:20:11Z")

</div>

Hello, I am developing my second Ghost theme named “[Aakari](https://github.com/vasanthdeveloper/aakari)”. Just before releasing the theme, I realized that Ghost is not allowing my theme to upload. I prepare the ZIP file of my theme with the `npm run package` command. Which actually runs `gulp package` .

The package task for Gulp is directly copied from the default Casper theme’s `gulpfile.js`. Here is the console output of Ghost when uploading my theme:

 ![Capture](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/8/8d5738bda520a1e2f8c5d7a7bd9995208010c927.png)

As the error says, I tested the generated archive using 7-Zip and WinRAR and both say that it is a valid archive. I also manually prepared an archive using 7-Zip and did not apply any compression. But still, I get this error. Please help me solve it and release my theme. This is a free theme and the whole source code is available for anybody who would like to use it, on GitHub.

[https://github.com/vasanthdeveloper/aakari](https://github.com/vasanthdeveloper/aakari)

* * *

## Update 2: Tired of creating the ZIP archive in a Linux environment.

A co-developer I work with pointed out [this](https://github.com/TryGhost/Ghost-Admin/pull/238) issue on GitHub. After reading and doing a bit of experiment, I decided to create the ZIP archive in a Linux environment. I used WSL (Windows Subsystem for Linux), and installed Ubuntu 18.04 and ran the `npm run package` command once again.

And ☹ sadly, the ZIP file did not get accepted by Ghost.

* * *

- **Version** 2.5.0
- **Environment** development
- **Database** sqlite3
- **Mail** Native

Thank You 🙂

---

<div class="post-metadata">

**Author:** ![Kate](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kate/32/35_2.png) [@Kate](https://forum.ghost.org/u/Kate)\
**Post date:** [November 15, 2018, 7:58am UTC](https://forum.ghost.org/t/ghost-says-invalid-zip-when-upload-my-theme/4001/2 "2018-11-15T07:58:58Z")

</div>

Could you pls open the developer console in your browser and record the upload request?  
The request will show you which content type is used in the form.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![vasanthdeveloper](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vasanthdeveloper/32/5227_2.png) [@vasanthdeveloper](https://forum.ghost.org/u/vasanthdeveloper)\
**Post date:** [November 16, 2018, 2:04pm UTC](https://forum.ghost.org/t/ghost-says-invalid-zip-when-upload-my-theme/4001/3 "2018-11-16T14:04:14Z")

</div>

Thanks for responding. Below is the screenshot of the error shown in Developer Tools Google Chrome Console:

![Capture](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex015/uploads/ghost2/original/2X/3/33715f414ddfaf7a0e7434ae8f6b4ccdebc7b774.png)

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [November 16, 2018, 2:30pm UTC](https://forum.ghost.org/t/ghost-says-invalid-zip-when-upload-my-theme/4001/4 "2018-11-16T14:30:17Z")

</div>

@vasanthdeveloper what we need is the network request headers to show which content type was sent by your browser. Eg:

![32](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex015/uploads/ghost2/original/2X/3/3daa3b05b81f0af7fb899b7fca4ce5c69b19d130.png)

---

<div class="post-metadata">

**Author:** ![vasanthdeveloper](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vasanthdeveloper/32/5227_2.png) [@vasanthdeveloper](https://forum.ghost.org/u/vasanthdeveloper)\
**Post date:** [November 19, 2018, 6:44pm UTC](https://forum.ghost.org/t/ghost-says-invalid-zip-when-upload-my-theme/4001/5 "2018-11-19T18:44:21Z")

</div>

I am really sorry for not responding from last 3 days. My health was a bit upset.  
Though I use the exact same GulpJS code from the Casper theme. It does not work. ☹  
Below is the screenshot of the Network tab:

![Capture](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex015/uploads/ghost2/original/2X/a/a1dc47b0f07d402568670c11453884069bdff032.png)

I really don’t know what is happening here though I am a web developer. The Content-Type seems to be different.  
Please help me ☹

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [November 19, 2018, 7:11pm UTC](https://forum.ghost.org/t/ghost-says-invalid-zip-when-upload-my-theme/4001/6 "2018-11-19T19:11:36Z")

</div>

The content-type is set by the browser/OS when uploading the file rather than by whatever generates the zip file. In this case your browser is sending `.zip` which is something we haven’t seen before so our content type validations are getting confused. Our validation will need to be updated to account for it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/b/ba9ce5100b8bb264586f4f572545596b2ce3f081.png) [@system](https://forum.ghost.org/u/system)\
**Post date:** [December 3, 2018, 7:11pm UTC](https://forum.ghost.org/t/ghost-says-invalid-zip-when-upload-my-theme/4001/7 "2018-12-03T19:11:38Z")

</div>

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