# Retrive docx and ppt via HTTP returns zip file

**URL:** <https://discuss.ipfs.tech/t/retrive-docx-and-ppt-via-http-returns-zip-file/713>\
**Category:** Help\
**Created:** [July 3, 2017, 7:03am UTC](https://discuss.ipfs.tech/t/retrive-docx-and-ppt-via-http-returns-zip-file/713 "2017-07-03T07:03:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepthi](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@deepthi](https://discuss.ipfs.tech/u/deepthi)\
**Post date:** [July 3, 2017, 7:03am UTC](https://discuss.ipfs.tech/t/retrive-docx-and-ppt-via-http-returns-zip-file/713/1 "2017-07-03T07:03:41Z")

</div>

Hi,  
I am uploading all kinds of files like .ppt,.pdf,.jpg,.docx etc to ipfs. And I am able to get the PDF images properly but for docx and ppt zipped folder is downloading. Can anyone help me with this please. Link I am using is  
http://:9393/ipfs/hash.

---

<div class="post-metadata">

**Author:** ![VictorBjelkholm](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/victorbjelkholm/32/10_2.png) [@VictorBjelkholm](https://discuss.ipfs.tech/u/VictorBjelkholm)\
**Post date:** [July 3, 2017, 10:14am UTC](https://discuss.ipfs.tech/t/retrive-docx-and-ppt-via-http-returns-zip-file/713/2 "2017-07-03T10:14:15Z")

</div>

When adding the files to IPFS, try adding the `--wrap-with-directory` flag to your command, so IPFS wraps your file in a directory and you keep the file extension.

This way, when downloading, you’ll use the link `http://:9393/ipfs/hash/filename.docx` and the file extension is kept intact, so your OS/Browser knows how to handle the file.

With go-ipfs, the command would be something like this:

```auto
$ ipfs add --wrap-with-directory mydocument.docx
added Qmami5EChMsYd4ATBGR8A5bpjcBzzzy4e3XR9fsSC3HUjt mydocument.docx
added QmSpJVvYRjktDVXr8XabDWAsWC1qabP6HZGwUQrDvzKPub

```

Then use the second hash + filename to retrieve it

FYI: updated the topic to be more descriptive.

---

<div class="post-metadata">

**Author:** ![JayBrown](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/jaybrown/32/107_2.png) [@JayBrown](https://discuss.ipfs.tech/u/JayBrown)\
**Post date:** [July 3, 2017, 10:33am UTC](https://discuss.ipfs.tech/t/retrive-docx-and-ppt-via-http-returns-zip-file/713/3 "2017-07-03T10:33:33Z")

</div>

Dir-wrapping isn’t necessary with all formats, but probably recommended, because if the browser doesn’t recognize the format, it’ll just download the file as plain data, so the recipient must know beforehand, what kind of format he’ll be downloading.

The main reason in this case is that **docx** is in fact a zipped directory which is just _called_ “docx” by Microsoft convention. (You can run `unzip` etc. on files like docx.) Therefore, if you don’t dir-wrap the docx-ipfs-object, it will be returned as a zip, because that’s what the browser is probably getting from the file header.
