Can I convert a Stream object to a FileInfo object?

Posted by Michael on Stack Overflow See other posts from Stack Overflow or by Michael
Published on 2010-03-17T13:15:50Z Indexed on 2010/03/17 13:21 UTC
Read the original article Hit count: 422

Filed under:
|

For the ExcelPackage constructor you need a FileInfo object. I rather use some kind of stream object(f.i. MemoryStream), because I don't need to save the file to the server itself, but expose it as a FileStream anyway to the user. I don't want to make files which I have to delete lateron from servers which are only there for generating purposes and never used again. Apart from that, otherwise I need also the necessary rights for the application/user on the directory/file on the server.

So my question is then: How can I convert a stream object to a FileInfo object.

© Stack Overflow or respective owner

Related posts about c#

Related posts about asp.net-mvc