I checked this, and it seems that installing DiskBufferSize bypasses the issue by disabling buffering. Now the computer will use more memory. Now buffering is effectively disabled. and the productivity you get from her is gone.
I think the correct solution is to use the SaveAs method to save the published file to a temporary folder in the FIRST postback and save the path to the temp file in the viewstate or session.
After any additional message or redirection, especially if asynchronous threads are involved, the SaveAs function will not work if buffering is required; You will receive the error "Unable to access the closed file."
I do not know what you have enclosed in your "session variable", but I assume that it is a file control, which is the problem.
This resolved the issue for me if others are working on it but don't want to disable buffering.
source share