Streaming ZIPPED files

Discussion in 'ASP .Net' started by Mark Kelly, May 11, 2004.

  1. Mark Kelly

    Mark Kelly Guest

    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
     
    Mark Kelly, May 11, 2004
    #1
    1. Advertising

  2. Mark Kelly

    Philip Rieck Guest

    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/OpenSource/SharpZipLib/Default.aspx




    "Mark Kelly" <mark.no$pam.kelly@f$nm.removemeandchange$tos.co.uk> wrote in
    message news:...
    > 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
    >
    >
     
    Philip Rieck, May 12, 2004
    #2
    1. Advertising

  3. Mark Kelly

    Jerry Pisk Guest

    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.uk> wrote in
    message news:...
    > 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
    >
    >
     
    Jerry Pisk, May 12, 2004
    #3
  4. Mark Kelly

    Mark Kelly Guest

    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" <> wrote in message
    news:%23Ur2$...
    > 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.uk> wrote in
    > message news:...
    > > 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
    > >
    > >

    >
    >
     
    Mark Kelly, May 12, 2004
    #4
  5. Mark Kelly

    Ed Courtenay Guest

    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" <> wrote in message
    > news:%23Ur2$...
    >
    >>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.uk> wrote in
    >>message news:...
    >>
    >>>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
     
    Ed Courtenay, May 12, 2004
    #5
  6. Mark Kelly

    Mark Kelly Guest

    Cheers Ed - this is exactly what i was looking for.

    "Ed Courtenay" <> wrote in
    message news:uDtQG%...
    > 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" <> wrote in message
    > > news:%23Ur2$...
    > >
    > >>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.uk> wrote

    in
    > >>message news:...
    > >>
    > >>>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
     
    Mark Kelly, May 12, 2004
    #6
  7. Mark Kelly

    Mark Kelly Guest

    Cheers Philip - This is exactly what i was looking for.

    "Philip Rieck" <> wrote in message
    news:%...
    > 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/OpenSource/SharpZipLib/Default.aspx
    >
    >
    >
    >
    > "Mark Kelly" <mark.no$pam.kelly@f$nm.removemeandchange$tos.co.uk> wrote in
    > message news:...
    > > 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
    > >
    > >

    >
    >
     
    Mark Kelly, May 12, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Amelyan

    Download zipped files

    Amelyan, Mar 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    412
    Amelyan
    Mar 7, 2006
  2. NB
    Replies:
    5
    Views:
    4,194
  3. =?Utf-8?B?Y2FzaGRlc2ttYWM=?=

    Zipped folder problem

    =?Utf-8?B?Y2FzaGRlc2ttYWM=?=, Jul 17, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    386
    =?Utf-8?B?Y2FzaGRlc2ttYWM=?=
    Jul 17, 2006
  4. mir nazim
    Replies:
    0
    Views:
    277
    mir nazim
    Dec 19, 2003
  5. Alan G Isaac

    decompress zipped files on Windows

    Alan G Isaac, Sep 23, 2004, in forum: Python
    Replies:
    0
    Views:
    306
    Alan G Isaac
    Sep 23, 2004
Loading...

Share This Page