开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜