DEXTUpload.NET
Class FileSaveOption
- The minimum supported version
- 5.0.0.0
- The minimum support environment
- .NET Framework 4.0
- Explanation
-
The "FileSaveOption" is a class that has the necessary settings when you use the "Save, SaveAs" methods of the "DEXTUpload.NET.IFileManagement" interface.
using (var dext = new FileUpload()) { var element = dext.GetFileElement("file1"); // When saving a temporary file, so if the same file name exists, it will no overwrite it by adding suffix after the file name. // In addition, after calling the Save method, the temporary file is not deleted because of the Copying property true. element.Save("~/files/store/subdir", new FileSaveOption { Copying = true, IsOverwrite = false, CheckingFreeSize = true }); // If you leave the using statement, the 'FileUpload' object removes all temporary files left over the current request. }
- Type
-
public class FileSaveOption
- Constructors
-
FileSaveOption
-
Does initialization when creating an instance of the "FileSaveOption" class.
-
Type
public FileSaveOption() public FileSaveOption(bool overwrite) (supported by 5.1.0.0) public FileSaveOption(bool overwrite, bool copy) public FileSaveOption(bool overwrite, bool copy, bool freesize) (supported by 5.1.0.0)
-
Parameters
Name Type Explanation overwrite System.Boolean If you want to overwrite when some files with the same name exist is "true". copy System.Boolean After you save the file, in order to maintain without deleting is a "false". freesize System.Boolean To check the disk capacity is a "true".
-
- Properties
-
IsOverwrite
-
Gets or sets whether or not to overwrite, when you save the file, if there is a file of the same name.
Overwritten to delete the object, say a bottle with the same name. By default, it is "true". If the value is set to "false", if a file with the same name exists, when you save the file, the numbers of the suffix is so attached to the end of the file name.
It is possible to crash when you create a file at the same time with the same name in a number of processes and threads.
-
Type
public bool IsOverwrite { get; set; }
Copying
-
Gets or sets whether or not to delete the temporary file after you have moved or copied to the location where you want to save the temporarily file.
If the value is "true", because there is a need can be copied, it does not delete the temporary file. In addition, the range of "Copying" option applied is effective until the point in time when the "DEXTUpload.NET.FileUpload" object does not call the "Dispose" method.
By default, it is "false".
-
Type
public bool Copying { get; set; }
CheckingFreeSize (support from 5.1.0.0 version)
-
Gets or sets whether or not to check the size of disk space when performing a copy operation finally.
When copying file(not moving), it checks the capacity of the target disk, only if there is a free space, performs a copy operation, if there is no space, an exception occurs. By default, it is "true".
When the check of free space on the disk is an environment that fails to set the "CheckingFreeSize" attribute to "false", it must be omitted the work of the pre-inspection.
-
Type
public bool CheckingFreeSize { get; set; }
-