DEXTUpload.NET
Class DXTEnvironment
- The minimum supported version
- 5.0.0.0
- The minimum support environment
- .NET Framework 4.0
- Explanation
-
Is a class that contains many settings of components.
The "DXTEnvironment" object has values analyzed about the "settings" element of "dextupload.net" section in the "Web.config" file whenever the "DEXTUpload.NET.FileUploadMonitorModule" module object processes each request. Because the most settings required for upload process are written directly at the "settings" element, it is rarely used to generate the object of "DXTEnvironment" class directly.
<configuration> <configSections> <!-- Defines a section for reading dextupload.net configuration. --> <sectionGroup name="dextupload.net"> <section name="settings" type="System.Configuration.SingleTagSectionHandler, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </sectionGroup> </configSections> <dextupload.net> <!-- Temporary path: Web application root/files/temp --> <!-- Default storage path: Web application root/files/store --> <!-- Individual upload limit size: 10MB = 10485760 (bytes)--> <!-- Total upload limit size: 20MB = 20971520 (bytes)--> <!-- Filtering with file extension name: txt, jpg, png, gif, docx, xlsx, pptx, hwp, pdf,zip --> <!-- Cleaner settings: Delete temporary files older than 24 hours per minute. --> <!-- Signature settings: Check file signatures using included resources. --> <!-- Trial Authentication Key: 9Ubwly9EZZZhBENEepU ... skip ... LeJyGxAJcB03gQQcM1Q --> <settings tempPath="~/files/temp" defaultPath="~/files/store" maxFileLength="10485760" maxTotalLength="20971520" whiteExtensions="txt,jpg,png,gif,docx,xlsx,pptx,hwp,pdf,zip" cleanerIntervalTime="60000" timeAgoForCleaning="24" enableCleaner="true" signatureDataFilePath="" methodFileSignatureChecking="absenceOrSame" authkey="9Ubwly9EZZZhBENEepUVHqG ... skip ... JyGxAJcB03gQQcM1Q" /> </dextupload.net> ... </configuration>
- Type
-
public class DXTEnvironment
- Constructors
-
DXTEnvironment
-
Does initialization when creating an instance of the "DXTEnvironment" class.
-
Type
public DXTEnvironment()
-
- Properties
-
DefaultRepository
-
Gets or sets the location where you want to save the file.
It is determined by the "defaultPath" attribute of the "settings" element of the "dextupload.net" section in the "Web.config" file. If the "defaultPath" attribute has not been determined, it is set as the value of the "tempPath" property.
-
Type
public string DefaultRepository { get; set; }
TempRepository
-
Gets or sets the location where you want to temporarily save the file.
In the process of obtaining the file by the component analyzes the multi-part data, the parsed data is immediately saved to a temporary location without saving the destination(defaultPath), this time, the file in the location is called temporary files. A temporary location is determined by the "tempPath" attribute of the "settings" element of the "dextupload.net" section in the "Web.config" file. Because it is a mandatory attribute the "tempPath" attribute, there is no default value. Therefore, be sure to set the property value.
-
Type
public string TempRepository { get; set; }
MaxFileLength
-
Gets or sets the maximum size(byte units) of files that are allowed.
The "MaxFileLength" refers to the maximum size of an individual file. It is determined by the "maxFileLength" attribute of the "settings" element of the "dextupload.net" section in the "Web.config" file. Note) If the value of the "MaxFileLength" property is greater than the requested data size limit in IIS, you may receive an error occurs during the upload.
The default value is -1, it means not checking the size of individual files.
-
Type
public long MaxFileLength { get; set; }
MaxTotalLength
-
Gets or sets thhe maximum allowable size(byte unit) sumed the size of all files.
The "MaxTotalLength" refers to the maximum size that means the sum of the size of the entire files. It is determined by the "maxTotalLength" attribute of the "settings" element of the "dextupload.net" section in the "Web.config" file. Note) If the value of the "MaxTotalLength" property is greater than the requested data size limit in IIS, you may receive an error occurs during the upload. However, in the process of uploading of large files called the Extension Upload, regardless of the setting value, it is ignored(without checking).
The default value is -1, it means not checking the size of individual files.
-
Type
public long MaxTotalLength { get; set; }
ExtensionTokens
-
Gets the "System.Collection.Generic.List<string>" object with a list of file extension names allowed uploading.
It is determined by the "whiteExtensions" attribute of the "settings" element of the "dextupload.net" section in the "Web.config" file. The value of the "whiteExtensions" attribute is a string that means the list of file extension names distinguished by comma(,) character. Extensions that has been declared here are not to reject the upload. If the "whiteExtensions" attribute is not defined, it does not limit the file by checking file extension name.
-
Type
public List<string> ExtensionTokens { get; }
PermittedEmptyExtension
-
Gets or sets whether or not to allow the file that has no extension name.
It is determined by the "availableNoFileExtension" attribute of the "settings" element of the "dextupload.net" section in the "Web.config" file.
By default, it is "true". In the case of "false", it does not allow a file without an extension.
-
Type
public bool PermittedEmptyExtension { get; set; }
UploadTimeout
-
Gets or sets the upload timeout period(in seconds).
If the "debug" attribute of the "compilation" element of the "System.web" section in the "Web.config" file is "false", it can limit the time of uploading. if the attribute is "true", because it is a debug mode, it is not effect for limiting time.
The default is 3600 seconds, when set to 60 seconds or less, is fixed to 60 seconds.
-
Type
public int UploadTimeout { get; set; }
CharEncoding
-
Gets or sets using the "System.Text.Encoding" object when processing the character string data in the internal components.
It is determined by the "encoding" attribute of the "settrings" element of the "dextupload.net" section in the "Web.config" file.
By default, it is "System.Text.Encoding.UTF8" instance.
-
Type
public Encoding CharEncoding { get; set; }
FilterAction
-
When uploading the file has become restricted, gets or sets the way to handle this.
It is determined by the "filterAction" attribute of the "settings" element of the "dextupload.net" section in the "Web.config" file.
When the temporary file is a limited target by analyzing(size, extension name, etc.), generally, it is exception handling. However, if the value of the "FilterAction" property is "DEXTUpload.NET.FilterAction.Flushing", the component creates a temporary file to 0-byte discarded the body. Note) In the upload process of large files called the Extension Upload, regardless of the setting value, and restricted occurs, an error will occur.
By default, it is "DEXTUpload.NET.FilterAction.Error". If the file is restricted, an error occurs.
-
Type
public FilterAction FilterAction { get; set; }
IsCompact
-
If the size of the file is 0 or empty, Gets or sets whether or not to remove the target field of the form.
It is determined by the "compact" attribute of the "settings" element of the "dextupload.net" section in the "Web.config" file.
If the file is empty, the HTML input tag refers to a case where there is no value. If the value of "IsCompact" property is "true", since the empty form field is deleted, the "DEXTUpload.NET.FileElement" object with the information of the file does not exist. Note) It is applied in the case of the size of the file is 0 too.
By default, it is "false", there is no field of the form that has been deleted.
-
Type
public bool IsCompact { get; set; }
CleanerIntervalTime
-
Gets or sets the interval of events for the delete operation by Cleaner.
Unit is milliseconds(1/1000), it cannot be specified under 1 minute. A small than or equal to "Int32.MaxValue".
By default, it is 60000 ms(1 minute).
-
Type
public double CleanerIntervalTime { get; set; }
TimeAgoForCleaning
-
Gets or sets a reference past time(hour) of the file to be deleted.
Unit is hour, the value is greater than 1, which is lower than or equal to "Int32.MaxValue".
The default is 24.
-
Type
public int TimeAgoForCleaning { get; set; }
EnableCleaner
-
If you set the "EnableCleaner" property to "true", when it starts uploading the first file, internally cleaner is started.
Cleaner is ready to delete the temporary files in the temporary folder(directorie) with the specfied or default values in the "CleanerIntervalTime, TimeAgoForCleaning" properties. For example, if the value of "CleanerIntervalTime" is 60000 and the value of "TimeAgoForCleaning" is 24, every minute, all files modifed before 24 hours are going to delete from the temporary folder pointed to "TempRepository" property. In the case of uploading of large files called the Extension Upload, if the temporary file exists, it is possible to re-upload after a few days. However, if the Cleaner is working, because the Cleaner will deleted files elapsed the time specified in the "TimeAgoForCleaning" property, it is impossible to re-upload.
When called the "Dispose" method of the "DEXTUpload.NET.FileUpload" object, it deletes temporary files. In contrast, the Cleaner is used to delete files missed even or the junk files that have occurred during the upload of large files in purpose. In addition, the Cleaner deletes targets even though using the "Keep" method of "DEXTUpload.NET.FileElement" class to use a temporary file itself. When sharing the same temporary folder of many web applications, in the course of multiple processes to remove the temporary files may be made I/O errors.
By default, it is "false".
-
Type
public bool EnableCleaner { get; set; }
SignatureDataFilePath (support from 5.2.0.0 version)
-
Gets or sets the path of the signature resource file that are required to the signature inspection.
The file signature resource, as a file needed to run checking file signature, is the basic resource that has been included in the component itself. If the path to the "SignatureDataFilePath" property is set, internally resource is not using but given path as a resource.
By default, is "null".
-
Type
public string SignatureDataFilePath { get; set; }
MethodFileSignatureChecking (support from 5.2.0.0 version)
-
Gets or sets the method of inspecting file signature.
By default, it is "FileSignatureMethod.NoChecking".
-
Type
public FileSignatureMethod MethodFileSignatureChecking { get; set; }
-