Getting a path of a Stream by converting to FileStream
I need to get the path of the original file in the stream.
I read that I need to use the "Name" property of the FileStream to get
it's path.
So far so good.
The problem is I have a regular System.IO.Stream and not FileStream, and
therefore I don't have the "Name" property.
I read that there is a Stream.CopyTo method:
http://msdn.microsoft.com/en-us/library/dd782932.aspx
I planned to convert my Stream to FileStream like that:
System.IO.FileStream fileStream = new System.IO.FileStream(?????);
using (stream)
{
stream.CopyTo(fileStream);
}
But FileStream has no parameterless constructor.
How can I solve it?
No comments:
Post a Comment