Keeping alive PostedFile.InputStream (ASP.NET)
Maybe it's the worst practice in the world, but I was wondering wich's the best way to "keep alive" the InputStream of the FileUpload Control.
I would give you one example. Let's assume you have the FileUpload control in one WebForm, and you want process it in the next WebForm (after Response.Redirect).
It would be great (unless for the memory) to have something similar to:
Session["PostedFile"] = this.FileUpload.PostedFile.InputStream.
开发者_StackOverflow中文版Unfortunately, this results in:
System.ObjectDisposedException
Thanks in advance.
Why don't you read the stream first and then add it to the session?
精彩评论