Click or drag to resize
Upload Class
Upload class for Editor. This class provides the ability to easily specify file upload information, specifically how the file should be recorded on the server (database and file system). An instance of this class is attached to a field using the 'Field.upload()' method. When Editor detects a file upload for that file the information provided for this instance is executed. The configuration is primarily driven through the 'db' and 'action' methods
Inheritance Hierarchy
SystemObject
  DataTablesUpload

Namespace:  DataTables
Assembly:  DataTables (in DataTables.dll) Version: 1.6.5.0 (1.6.5.0)
Syntax
C#
public class Upload

The Upload type exposes the following members.

Constructors
Methods
  NameDescription
Public methodAction(FuncHttpPostedFile, Object, Object)
Set the action to take when a file is uploaded. As a function the callback is given the responsiblity of what to do with the uploaded file. That will typically involve writing it to the file system so it can be used later.
Public methodAction(String)
Set the action to take when a file is uploaded. As a string the value given is the full system path to where the uploaded file is written to. The value given can include three "macros" which are replaced by the script dependent on the uploaded file: * '__EXTN__' - the file extension (with the dot) * '__NAME__' - the uploaded file's name (including the extension) * '__ID__' - Database primary key value if the 'Db()' method is used
Public methodAllowedExtensions
A list of valid file extensions that can be uploaded. This is for simple validation that the file is of the expected type. The check is case-insensitive. If no extensions are given, no validation is performed on the file extension.
Public methodDb
Database configuration method. When used, this method will tell Editor what information you want to be wirtten to a database on file upload, should you wish to store relational information about your files on the database (this is generally recommended).
Public methodDbClean(FuncListDictionaryString, Object, Boolean)
Set a callback function that is used to remove files which no longer have a reference in a source table.
Public methodDbClean(String, FuncListDictionaryString, Object, Boolean)
Set a callback function that is used to remove files which no longer have a reference in a source table.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValidator
Add a validation method to check file uploads. Multiple validators can be added by calling this method multiple times. They will be executed in sequence when a file has been uploaded.
Public methodWhere
Add one or more WHERE conditions to the data that is retrieved from the database when querying it for the list of available files in a table.
Top
See Also