DEXTUpload.NET Professional
menu toggleReferences > DEXTUpload.NET > ObfuscationOtpion

DEXTUpload.NET
Class ObfuscationOtpion

The minimum supported version
5.1.0.0
The minimum support environment
.NET Framework 4.0
Explanation

The "ObfuscationOtpion" is a class for a parameter that contains settings to obfuscate the file name when saving the temporary file to destination by the "Save" method of the "DEXTUpload.NET.IFileManagement" interface.

using (var dext = new FileUpload())
{
    var element = dext.GetFileElement("file1");
    // When saving a temporary file, the name of the original file is stored as an unknown.
    element.Save("~/files/store/subdir", new ObfuscationOption { 
        IsObfuscation = true, 
        KeepExtensionName = true,
        PrefixName = "SITE-A-ZONE-AA-"
    });
    // The saved file name is like 'SITE-A-ZONE-AA-fa497c926c1a4390bb0a87fec0d7c55e.jpg'.
}

This obfuscation technique, without the use of other hash technology, deletes a prefix and "-" character of the temporary file name and use remained name.

In addition, even if obfuscate the file name, it is possible to maintain the file extension. However, it is recommended not to maintain the file extension for security.

Type
public class ObfuscationOption
Constructors

ObfuscationOption

  • Does initialization when creating an instance of the "ObfuscationOption" class.

  • Type

    public ObfuscationOption()
    public ObfuscationOption(bool isObfuscation)
    public ObfuscationOption(bool isObfuscation, bool keepExtensionName)
    public ObfuscationOption(bool isObfuscation, bool keepExtensionName, string prefixName)
  • Parameters

    Name Type Explanation
    isObfuscation System.Boolean Whether or not to use the obfuscation. To obfuscation is a "true".
    keepExtensionName System.Boolean Whether or not to maintain the file extension. To maintain is "true".
    prefixName System.String The Prefix name.
Properties

IsObfuscation

  • Gets or sets whether or not to use obfuscation.

    Default is "false". The other properties associated with the obfuscation will be ignored if this is "false".

  • Type

    public bool IsObfuscation { get; set; }

KeepExtensionName

  • Gets or sets whether or not to maintain the file extension.

    By default is "false". If there is a need to maintain the extension, it is "true". However, for security, it is not recommended to set this value to "true".

  • Type

    public bool KeepExtensionName { get; set; }

PrefixName

  • Gets or sets the prefix of the file name.

    If you need to the classification in the file name, it is possible to specify the prefix.

    By default, is "null", the empty string is processed like "null".

  • Type

    public string PrefixName { get; set; }