DEXTUpload.NET
Class FileUploadMonitorModule
- The minimum supported version
- 5.0.0.0
- The minimum support environment
- .NET Framework 4.0
- Explanation
-
The "FileUploadMonitorModule" class is responsible to analyze the the multi-part data from request that has been transferred from the client.
When a request is a multi-part data, this class creates temporary files and classifies strings and files, generates a "DEXTUpload.NET.MultipartCollection" object for handling file upload easily. This collection object will be included the "DEXTUpload.NET.FileUpload" object or used as a data provider in MVC so that it can be used in codes created by developers.
The "FileUploadMonitorModule" class implements the "System.Web.IHttpModule" interface. So it is registered as a HTTP module in the "Web.config" file without generating the code by developers.
To register in IIS 7.x or more that is running in the Classic mode
<configuration> <system.web> <httpModules> <add name="FileUploadMonitorModule" type="DEXTUpload.NET.FileUploadMonitorModule, DEXTUpload.NET, Version=5.0.0.0, Culture=neutral, PublicKeyToken=d71d611ccd9cc3c0" /> </httpModules> </system.web> <system.webServer> <modules> <add name="FileUploadMonitorModule" type="DEXTUpload.NET.FileUploadMonitorModule, DEXTUpload.NET, Version=5.0.0.0, Culture=neutral, PublicKeyToken=d71d611ccd9cc3c0" preCondition="managedHandler" /> </modules> </system.webServer> </configuration>
To register in IIS 7.x or more that is running in the Integrated mode
<configuration> <system.webServer> <modules> <add name="FileUploadMonitorModule" type="DEXTUpload.NET.FileUploadMonitorModule, DEXTUpload.NET, Version=5.0.0.0, Culture=neutral, PublicKeyToken=d71d611ccd9cc3c0" preCondition="managedHandler" /> </modules> </system.webServer> </configuration>
The old Visual Studio is not able to test applications in the Integration mode, but recent versions, it is possible to test in the Integrate mode using the IIS Express.
If it is not possible to test in the Integrated mode, change to the Classic mode, or there is a need to test directly in the local IIS.
- Type
-
public class FileUploadMonitorModule : IHttpModule
- Methods
-
Dispose
-
Removes the resources used by the module. The "Dispose" method performs final cleaning up before removed the module thourgh the execution pipeline.
-
Type
public void Dispose()
Init
- Initializes and prepares to process the request.
-
Type
public void Init(HttpApplication context)
-
Parameters
Name Type Explanation context System.Web.HttpApplication The object to be able to access methods, properties, and events that are commonly used all over the ASP.NET application.
HandleUploadProcess
- Create temporary files from multi-part data that has been transmitted from the client, transmits a collection object to complete the process of uploading files.
-
Type
protected virtual void HandleUploadProcess(HttpApplication application, DXTEnvironment environment)
-
Parameters
Name Type Explanation application System.Web.HttpApplication The object to be able to access methods, properties, and events that are commonly used all over the ASP.NET application. environment DEXTUpload.NET.DXTEnvironment the "DEXTUpload.NET.DXTEnvironment" object contains a variety of settings of the component.
RemoveTempResources
-
Deletes temporary resources.
If the Cleaner is started, the temporary files that are included in the temporary folder are deleted by the Cleaner calling the "RemoveTempResources" method regularly.
-
Type
protected virtual void RemoveTempResources(DirectoryInfo temp, int ago)
-
Parameters
Name Type Explanation temp System.IO.DirectoryInfo The object that points to the folder where the temporary file exists. ago System.Int32 The past time(hour) that determines files to be deleted by the Cleaner.
-