DEXTUpload.NET Professional
menu toggleReferences > DEXTUpload.NET > IFileManagement

DEXTUpload.NET
Interface IFileManagement

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

A class that implements the "IFileManagement" interface must provide a variety of functions for handling temporary files.

An implemented class, in addition to the basic information of the temporary file, provides methods for saving temporary files to a specific location.

Implementation classes

Type
public interface IFileManagement
Properties

IsEmpty

  • Gets whether or not an empty file.

    An empty file, but the element exists, it is when there is no actual file information. If "true" is returned, the value of the "FileName" property is an empty string, the value of the "FileLength" property must be -1.

  • Type

    bool IsEmpty { get; }

IsEligibleFile

  • Gets whether or not the element has file content.

    The file must exist, the size of the file must be greater than zero.

    Note) This component allows to upload an empty file. So if a zero-byte file, the value of the "IsEligibleFile" property is set to "false".

  • Type

    bool IsEligibleFile { get; }

MimeType

  • Gets the value of the MIME type of file.

    The "MimeType" property returns the value of the "Content-Type" of each form element in the multi-part data. Because this value was analyzed and transmitted by the client on its own way, it can be a wrong value. Therefore, the "MimeType" should be used only for reference.

  • Type

    string MimeType { get; }

FullName

  • Gets a full name of the file.

    It means the full file name that have been recorded on the "Content-Disposition" header. For example, in the case of Internet Explorer, on the basis of a set of Internet options, it is a physical path to include the name of the file.

  • Type

    string FullName { get; }

FileName

  • Gets the name of the file.

    The returned value does not include the path of client, and it is a name combined "FileNameWithoutExt" and "FileExtension" properties.

  • Type

    string FileName { get; }

FileNameWithoutExt

  • Get a part of the name of the file without the extension.

  • Type

    string FileNameWithoutExt { get; }

FileExtension

  • Gets the extension part of the file name.

    Returned value has the "." character, but if the file has no an extension part, returns an empty string.

  • Type

    string FileExtension { get; }

FileLength

  • Gets the size(byte) of the file.

    If the file will be restricted by filtering and the filtering option is "DEXTUpload.NET.FilterAction.Flushing", returns 0. In contrast, if it is an empty file, returns -1 not 0.

  • Type

    long FileLength { get; }

OriginalFileLength

  • Gets the original size(byte) of the file.

    When a file is filtered and the filtering method is "DEXTUpload.NET.FilterAction.Flusing", the size of the file is 0.

    The "OriginalFileLength" property, regardless of the change in the size of the file by the filter processing, returns the size of the file that was sent from the original client. If an empty file, the size is -1 not 0.

  • Type

    long OriginalFileLength { get; }

IsFiltered

  • Gets whether or not the file has been filtered.

  • Type

    bool IsFiltered { get; }

IsImage

  • Gets whether or not the file is a image.

    It is only a form the "System.Drawing.Image" class-readable of the .NET Framework rather than all types of image files.

  • Type

    bool IsImage { get; }

ImageFormat

  • If the file is an image, gets a value of the "System.Drawing.Imaging.ImageFormat".

  • Type

    ImageFormat ImageFormat { get; }

ImageWidth

  • If the file is an image, gets the length of the width of the image.

    If it's not image, gets -1.

  • Type

    int ImageWidth { get; }

ImageHeight

  • If the file is a image, gets the length of the height of the image.

    If it's not image, gets -1.

  • Type

    int ImageHeight { get; }

TempFilePath

  • Gets the path of the temporary file.

  • Type

    string TempFilePath { get; }

LastSavedFilePath

  • Gets the stored path by "Save, SaveAs" methods.

  • Type

    string LastSavedFilePath { get; }

LastSavedFileName

  • Gets the name of the file saved by "Save, SaveAs" methods.

  • Type

    string LastSavedFileName { get; }

IsKeeping

  • Gets whether or not the temporary used itself without saving.

    When the "Keep" method is called, the value of the "IsKeep" property is "true". The value of the "LastSavedFilePath" property is set to the path of the temporary file, the value of the "LastSavedFileName" property is changed to a temporary file name.

  • Type

    bool IsKeeping { get; }
Methods

SaveAs

  • Temporarily file saves under other name, returns the path of the saved file.
  • Type

    string SaveAs(string targetPath)
    string SaveAs(FileInfo target)
    string SaveAs(string targetPath, FileSaveOption option)
    string SaveAs(FileInfo target, FileSaveOption option)
  • Parameters

    Name Type Explanation
    targetPath System.String The path(a sub-path of Web applications or a physical path on the local operating system) to save the temporary file.
    target System.IO.FileInfo An object with a path information to save the temporary file.
    option DEXTUpload.NET.FileSaveOption An setting object when saving files.
  • Return

    The physical path of the saved file.

Save

  • Temporarily file saves, returns the path of the saved file.
  • Type

    string Save()
    string Save(FileSaveOption option)
    string Save(string directoryPath)
    string Save(DirectoryInfo directory)
    string Save(string directoryPath, FileSaveOption option)
    string Save(DirectoryInfo directory, FileSaveOption option)
    
    string Save(ObfuscationOption obfuscationOption)
    string Save(ObfuscationOption obfuscationOption, FileSaveOption option)
    string Save(string directoryPath, ObfuscationOption obfuscationOption)
    string Save(DirectoryInfo directory, ObfuscationOption obfuscationOption)
    string Save(string directoryPath, ObfuscationOption obfuscationOption, FileSaveOption option)
    string Save(DirectoryInfo directory, ObfuscationOption obfuscationOption, FileSaveOption option)
    
  • Parameters

    Name Type Explanation
    directoryPath System.String The directory path(a sub-path of Web applications or a physical path on the local operating system) to save the temporary file.
    directory System.IO.DirectoryInfo An object with the directory path information to save the temporary file.
    obfuscationOption DEXTUpload.NET.ObfuscationOtpion An object with the option information of the file name obfuscation.
    option DEXTUpload.NET.FileSaveOption An setting object when saving files.
  • Return

    The physical path of the saved file.

Keep

  • Holds a temporary file, and returns its path.

    When the "Keep" method is called, the value of the "IsKeep" property is "true". The value of the "LastSavedFilePath" property is set to the path of the temporary file, the value of the "LastSavedFileName" property is changed to a temporary file name.

    The "Keep" method maintains temporary file itself. When the method is called, even if using the "FileUpload.Dispose" method or the "UseDEXTAttribute" attribute, temporary files will be not deleted. However, if you use the cleaner, temprary files will be deleted. For more information, refers to the "Clean operation guide of the temporary files".

  • Type

    string Keep()
  • Return

    The physical path of temporary files.

DeleteTempFile

  • Removes the temporary files.

    When the "IsKeep" property is "true", even if this method called, temporary files are not deleted.

  • Type

    bool DeleteTempFile()
  • Return

    Whether or no temporary files have been deleted.

ReadText (support from 5.2.0.0 version)

  • Read the file in a text file format, and returns the content.

    When reading the file, if the character set is omitted, the file will be read in UTF-8 character set.

  • Type

    string ReadText()
    string ReadText(System.Text.Encoding encoding)
    
  • Parameters

    Name Type Explanation
    encoding System.Text.Encoding A character encoding. If omitted, read in the UTF-8 character set.
  • Return

    The content of the file.