# ZipFile.jl

**URL:** https://discourse.julialang.org/t/zipfile-jl/6619
**Category:** General Usage
**Tags:** zip
**Created:** [October 23, 2017, 5:36am UTC](https://discourse.julialang.org/t/zipfile-jl/6619 "2017-10-23T05:36:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rcnlee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rcnlee/32/4107_2.png) [@rcnlee](https://discourse.julialang.org/u/rcnlee)
#### Post date: [October 23, 2017, 5:36am UTC](https://discourse.julialang.org/t/zipfile-jl/6619/1 "2017-10-23T05:36:50Z")

</div>

Hello,

The README for ZipFile.jl talks about writing to a new zip file and reading from it. Is there a way to add a file to an existing zip file? i.e., append a file?

Thanks,

Ritchie

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [October 23, 2017, 7:02am UTC](https://discourse.julialang.org/t/zipfile-jl/6619/2 "2017-10-23T07:02:54Z")

</div>

Seems to be the very first example [in the documentation](https://zipfilejl.readthedocs.io/en/latest/).

---

<div class="post-metadata">

### Author: ![rcnlee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rcnlee/32/4107_2.png) [@rcnlee](https://discourse.julialang.org/u/rcnlee)
#### Post date: [October 23, 2017, 7:04pm UTC](https://discourse.julialang.org/t/zipfile-jl/6619/3 "2017-10-23T19:04:26Z")

</div>

Hi Tamas, thank you for your quick reply.

The first example creates a new zip file and then appends files to it. I have an existing zip file. I would like to open it and add files to it. For example,

1. Create “myzip.zip”, add “file1.txt”, close “myzip.zip”.
2. Later…, open “myzip.zip”, add “file2.txt”, close “myzip.zip”. At this point, “myzip.zip” should contain two files.

Ritchie

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [October 24, 2017, 6:47am UTC](https://discourse.julialang.org/t/zipfile-jl/6619/4 "2017-10-24T06:47:54Z")

</div>

I think that you can open a zip file, read & store the contents, and then create a new one, write out the contents + the new file. That said, perhaps you could open an issue to get the desired behavior, since the pieces seem to be there.

Also see  
[https://github.com/samoconnor/InfoZIP.jl](https://github.com/samoconnor/InfoZIP.jl)  
which seems to support adding files.
