That's why your have your server part to tell the difference of the state before and after uploading.
Let's assume you have form on the page using the method "POST", and the target URI will be the same as referral page which is prescribed by the
action
attribute of the
form
tag. You feel in some data, part of this data is the file. When you click "Submit" button you start uploading, receive HTTP response which you the page with the same URI. When a server side generates this page, it has some information to be taken into account: 1) post data is not empty; 2) the uploaded file physically present in the file system of the server. As HTTP protocol is stateless, your should rely on some change in state as it is stored on the server side; the presence of the file is one of the changes; and this is a very simple example.
In more complex situation, you may want to track the history of submissions of files by some user and more. This data can be stored in database and serves as a persistent state data available between HTTP request. Every time you process HTTP request and generate HTTP response, you can use this data to modify response accordingly, no matter if your request URI is the same or different — it does not carry state information.
In general case, you use session state management, please see:
http://msdn.microsoft.com/en-us/library/ms178581.aspx[
^].
See also this article:
http://msdn.microsoft.com/en-us/magazine/cc163730.aspx[
^].
Please see also these CodeProject articles:
Session Management in ASP.NET[
^],
Session management options in ASP.NET[
^],
ASP.NET Session Management Internals[
^].
—SA