Create a Stream without having a physical file to create from.

Posted by jhorton on Stack Overflow See other posts from Stack Overflow or by jhorton
Published on 2010-04-12T15:05:08Z Indexed on 2010/04/12 15:13 UTC
Read the original article Hit count: 276

Filed under:
|
|
|

I'm needing to create a zip file containing documents that exist on the server. I am using the .Net Package class to do so, and to create a new Package (which is the zip file) I have to have either a path to a physical file or a stream. I am trying to not create an actual file that would be the zip file, instead just create a stream that would exist in memory or something.

My question is how do you instantiate a new Stream (i.e. FileStream, MemoryStream, etc) without having a physical file to instantiate from.

© Stack Overflow or respective owner

Related posts about c#

Related posts about stream