By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,649 Members | 2,154 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,649 IT Pros & Developers. It's quick & easy.

Streaming ZIPPED files

P: n/a
Hi (apologies for the xpost, but im not sure where this fits in),

I have recently had a site demostrated to me (a newsgroup binaries archive
site) that allows a user to select multiple files, then download the
selected files combined as one zip. At first i thought this was nothing
special, until it was pointed out that the download commenced immediately,
and some of the many selected files were almost a GB in size. The only
conclusions I can draw from this is that either a) they have a super-fast
zip service working in the background (which i think is unlikely), or b) you
can somehow 'stream' a zip file as it is created - which i think is the more
likely option. I've noticed that none of the zips are compressed and was
wondering if its possible to somehow add a zip header to the response,
followed by binarywrites of the selected files?

If anybody can shed any light (point me in the direction of
articles/components/examples) on how to do this using c#/asp.net I would
really appreciate it.

tia.

Mark Kelly
Nov 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Try looking at the #ziplib from #develop. It has a "xxxOutputStream"s (like
ZipOutputStream) that will write to a base stream instead of a file. This
way, you can start sending the stream immediately and still add files (or
even parts of files) as the client recieves it.

http://www.icsharpcode.net/OpenSourc...b/Default.aspx


"Mark Kelly" <mark.no$pam.kelly@f$nm.removemeandchange$tos.co.u k> wrote in
message news:uH**************@TK2MSFTNGP12.phx.gbl...
Hi (apologies for the xpost, but im not sure where this fits in),

I have recently had a site demostrated to me (a newsgroup binaries archive
site) that allows a user to select multiple files, then download the
selected files combined as one zip. At first i thought this was nothing
special, until it was pointed out that the download commenced immediately,
and some of the many selected files were almost a GB in size. The only
conclusions I can draw from this is that either a) they have a super-fast
zip service working in the background (which i think is unlikely), or b) you can somehow 'stream' a zip file as it is created - which i think is the more likely option. I've noticed that none of the zips are compressed and was
wondering if its possible to somehow add a zip header to the response,
followed by binarywrites of the selected files?

If anybody can shed any light (point me in the direction of
articles/components/examples) on how to do this using c#/asp.net I would
really appreciate it.

tia.

Mark Kelly

Nov 18 '05 #2

P: n/a
Yes it is possible to create zip files on the fly, the actual implementation
will depend on which zip library you use, since .Net framework doesn't come
with one.

Jerry

"Mark Kelly" <mark.no$pam.kelly@f$nm.removemeandchange$tos.co.u k> wrote in
message news:uH**************@TK2MSFTNGP12.phx.gbl...
Hi (apologies for the xpost, but im not sure where this fits in),

I have recently had a site demostrated to me (a newsgroup binaries archive
site) that allows a user to select multiple files, then download the
selected files combined as one zip. At first i thought this was nothing
special, until it was pointed out that the download commenced immediately,
and some of the many selected files were almost a GB in size. The only
conclusions I can draw from this is that either a) they have a super-fast
zip service working in the background (which i think is unlikely), or b) you can somehow 'stream' a zip file as it is created - which i think is the more likely option. I've noticed that none of the zips are compressed and was
wondering if its possible to somehow add a zip header to the response,
followed by binarywrites of the selected files?

If anybody can shed any light (point me in the direction of
articles/components/examples) on how to do this using c#/asp.net I would
really appreciate it.

tia.

Mark Kelly

Nov 18 '05 #3

P: n/a
Hi Jerry

I understand that its possible to create zip files on the fly, I'm wondering
how you start sending the zip to the client, before you've finished creating
it!

"Jerry Pisk" <je******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Yes it is possible to create zip files on the fly, the actual implementation will depend on which zip library you use, since .Net framework doesn't come with one.

Jerry

"Mark Kelly" <mark.no$pam.kelly@f$nm.removemeandchange$tos.co.u k> wrote in
message news:uH**************@TK2MSFTNGP12.phx.gbl...
Hi (apologies for the xpost, but im not sure where this fits in),

I have recently had a site demostrated to me (a newsgroup binaries archive site) that allows a user to select multiple files, then download the
selected files combined as one zip. At first i thought this was nothing
special, until it was pointed out that the download commenced immediately, and some of the many selected files were almost a GB in size. The only
conclusions I can draw from this is that either a) they have a super-fast zip service working in the background (which i think is unlikely), or b)

you
can somehow 'stream' a zip file as it is created - which i think is the

more
likely option. I've noticed that none of the zips are compressed and was
wondering if its possible to somehow add a zip header to the response,
followed by binarywrites of the selected files?

If anybody can shed any light (point me in the direction of
articles/components/examples) on how to do this using c#/asp.net I would
really appreciate it.

tia.

Mark Kelly


Nov 18 '05 #4

P: n/a
Mark Kelly wrote:
Hi Jerry

I understand that its possible to create zip files on the fly, I'm wondering
how you start sending the zip to the client, before you've finished creating
it!
If you use the SharpZipLib library, you create a ZipOutputStream which
you wrap around an exisiting stream and then write to it using standard
StreamWriter classes.

As you write data to the ZipOutputStream, it's compressed on the fly and
sent to its eventual destination. In this way, you don't even have to
create a local file before sending it to the remote client!


"Jerry Pisk" <je******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Yes it is possible to create zip files on the fly, the actual


implementation
will depend on which zip library you use, since .Net framework doesn't


come
with one.

Jerry

"Mark Kelly" <mark.no$pam.kelly@f$nm.removemeandchange$tos.co.u k> wrote in
message news:uH**************@TK2MSFTNGP12.phx.gbl...
Hi (apologies for the xpost, but im not sure where this fits in),

I have recently had a site demostrated to me (a newsgroup binaries
archive
site) that allows a user to select multiple files, then download the
selected files combined as one zip. At first i thought this was nothing
special, until it was pointed out that the download commenced
immediately,
and some of the many selected files were almost a GB in size. The only
conclusions I can draw from this is that either a) they have a
super-fast
zip service working in the background (which i think is unlikely), or b)


you
can somehow 'stream' a zip file as it is created - which i think is the


more
likely option. I've noticed that none of the zips are compressed and was
wondering if its possible to somehow add a zip header to the response,
followed by binarywrites of the selected files?

If anybody can shed any light (point me in the direction of
articles/components/examples) on how to do this using c#/asp.net I would
really appreciate it.

tia.

Mark Kelly



--

Ed Courtenay
[MCP, MCSD]
http://www.edcourtenay.co.uk
Nov 18 '05 #5

P: n/a
Cheers Ed - this is exactly what i was looking for.

"Ed Courtenay" <re*****************************@edcourtenay.co.uk > wrote in
message news:uD****************@TK2MSFTNGP12.phx.gbl...
Mark Kelly wrote:
Hi Jerry

I understand that its possible to create zip files on the fly, I'm wondering how you start sending the zip to the client, before you've finished creating it!


If you use the SharpZipLib library, you create a ZipOutputStream which
you wrap around an exisiting stream and then write to it using standard
StreamWriter classes.

As you write data to the ZipOutputStream, it's compressed on the fly and
sent to its eventual destination. In this way, you don't even have to
create a local file before sending it to the remote client!


"Jerry Pisk" <je******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Yes it is possible to create zip files on the fly, the actual


implementation
will depend on which zip library you use, since .Net framework doesn't


come
with one.

Jerry

"Mark Kelly" <mark.no$pam.kelly@f$nm.removemeandchange$tos.co.u k> wrote inmessage news:uH**************@TK2MSFTNGP12.phx.gbl...

Hi (apologies for the xpost, but im not sure where this fits in),

I have recently had a site demostrated to me (a newsgroup binaries


archive
site) that allows a user to select multiple files, then download the
selected files combined as one zip. At first i thought this was nothing
special, until it was pointed out that the download commenced


immediately,
and some of the many selected files were almost a GB in size. The only
conclusions I can draw from this is that either a) they have a


super-fast
zip service working in the background (which i think is unlikely), or b)
you

can somehow 'stream' a zip file as it is created - which i think is the

more

likely option. I've noticed that none of the zips are compressed and waswondering if its possible to somehow add a zip header to the response,
followed by binarywrites of the selected files?

If anybody can shed any light (point me in the direction of
articles/components/examples) on how to do this using c#/asp.net I wouldreally appreciate it.

tia.

Mark Kelly


--

Ed Courtenay
[MCP, MCSD]
http://www.edcourtenay.co.uk

Nov 18 '05 #6

P: n/a
Cheers Philip - This is exactly what i was looking for.

"Philip Rieck" <st***@mckraken.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Try looking at the #ziplib from #develop. It has a "xxxOutputStream"s (like ZipOutputStream) that will write to a base stream instead of a file. This
way, you can start sending the stream immediately and still add files (or
even parts of files) as the client recieves it.

http://www.icsharpcode.net/OpenSourc...b/Default.aspx


"Mark Kelly" <mark.no$pam.kelly@f$nm.removemeandchange$tos.co.u k> wrote in
message news:uH**************@TK2MSFTNGP12.phx.gbl...
Hi (apologies for the xpost, but im not sure where this fits in),

I have recently had a site demostrated to me (a newsgroup binaries archive site) that allows a user to select multiple files, then download the
selected files combined as one zip. At first i thought this was nothing
special, until it was pointed out that the download commenced immediately, and some of the many selected files were almost a GB in size. The only
conclusions I can draw from this is that either a) they have a super-fast zip service working in the background (which i think is unlikely), or b)

you
can somehow 'stream' a zip file as it is created - which i think is the

more
likely option. I've noticed that none of the zips are compressed and was
wondering if its possible to somehow add a zip header to the response,
followed by binarywrites of the selected files?

If anybody can shed any light (point me in the direction of
articles/components/examples) on how to do this using c#/asp.net I would
really appreciate it.

tia.

Mark Kelly


Nov 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.