# Creating a Binary Vector from a ZIP File

**URL:** <https://discourse.julialang.org/t/creating-a-binary-vector-from-a-zip-file/93044>\
**Category:** Data\
**Tags:** question\
**Created:** [January 16, 2023, 7:42pm UTC](https://discourse.julialang.org/t/creating-a-binary-vector-from-a-zip-file/93044 "2023-01-16T19:42:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxstb11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maxstb11/32/45914_2.png) [@maxstb11](https://discourse.julialang.org/u/maxstb11)\
**Post date:** [January 16, 2023, 7:42pm UTC](https://discourse.julialang.org/t/creating-a-binary-vector-from-a-zip-file/93044/1 "2023-01-16T19:42:28Z")

</div>

Hello everyone,

I have an Issue getting the correct binary Vector of a ZIP File when using the Package ZipFile.jl

I want to use the GoogleCloud.jl Package to upload a zip file. Since the insert method only allows to pass Strings, Dicts or BinaryVectors I tried to hand over the last type.  
This is how far I have come till now:

```julia
# this part is taken from the ZipFile.jl Docstrings
using ZipFile
w = ZipFile.Writer("/tmp/example.zip")
f = ZipFile.addfile(w, "hello.txt")
write(f, "hello world!")
f = ZipFile.addfile(w, "julia.txt", method=ZipFile.Deflate)
write(f, "Julia"^5)
close(w)
r = ZipFile.Reader("/tmp/example.zip")

# this will give me the BitVector
take!(r._io) 

```

Using the insert method will be successful but if i later on download the file it seems like its corrupted and I cannot open it. I use the ZipFile package because it has been the most promising way to get the BitVector so far.

Does anyone has the answer for overcoming this issue?
