Progress State-Store

Mediachase FileUploader.NET provides a simple and easy-to-use progress-state model that you can use to get a progress information across multiple file uploads (POST requests). It accomplishes this using either in-memory cash of object references or sql table.

When using the in-process progress-state mode consider the following limitations: progress-state data is lost if aspnet_wp.exe or the application domain restarts. These restarts commonly occur in the following circumstances:
  • Setting an attribute in the <processModel> element of the application's Web.config file that causes a new process to start when a condition is met, such as memoryLimit.
  • The Global.asax or Web.config file is modified.
  • Changes to the \Bin directory of the Web application.
  • Antivirus software scans and modifies the Global.asax file, the Web.config file, or a file in the \Bin directory of the Web application.    
In Sql mode, progress states are stored in a Sql Server database and the worker process talks directly to Sql. Sql mode solves the progress information loss problem in InProc mode and allows a webfarm to store progress on a central server.

Configuring In-process Mode

In-process is the default progress state mode. To use in-process mode, set the Mode attribute of the element to progressState . The following shows a sample configuration setting for in-process mode.
<Mediachase.FileUploader.McHttpModule>
	<progressState Mode="InProcess"/>
</Mediachase.FileUploader.McHttpModule>

Configuring Sql Server Mode

To use SQL Server, first run either InstallSqlState.sql or InstallPersistSqlState.sql on the computer with SQL Server that will store the progress state. Both scripts create a table called McFileUpForm and several stored procedures. The difference between the scripts is where the McFileUpForm table are placed. The InstallSqlState.sql script adds this tables to the TempDB database, which loses progress data if the computer is restarted. The InstallPersistSqlState.sql script, on the other hand, adds this table to the FileUpState database, which allows progress data to be retained when the computer is restarted.

Both of these script files are installed by default at the following location:

FileuploaderInstallDir\Sql Scripts\

Next, set the Mode attribute of the <progressState> element to SqlServer in the Web.config file of the application. Finally, set the ConnectionString attribute to Integrated Security=SSPI;data source=serverName;Initial Catalog=databaseName; .


<Mediachase.FileUploader.McHttpModule>
	<progressState Mode="SqlServer" ConnectionString="Integrated Security=SSPI;data source=serverName; Initial Catalog =databaseName;"/>
</Mediachase.FileUploader.McHttpModule>

Copyright 2005 Mediachase. All rights reserved.