BaseUploadEditorAttribute class
namespace: Serenity.ComponentModel assembly: Serenity.Net.Core
Sets editor type as "ImageUpload", which only allows image files. Make sure you use this attribute in Row.cs, not Form.cs as the image upload behavior only works if it is in the row, otherwise your files will stay in the temporary directory.
[AttributeUsage(AttributeTargets.All)]
public abstract class BaseUploadEditorAttribute : CustomEditorAttribute, IUploadEditor,
IUploadFileConstraints, IUploadFileOptions, IUploadImageConstraints, IUploadImageOptions
| parameter | description |
|---|---|
| editorType | Type of the editor. |
Public Members
| name | description |
|---|---|
| AllowedExtensions { get; set; } | |
| AllowNonImage { get; set; } | |
| CopyToHistory { get; set; } | |
| DisableDefaultBehavior { get; set; } | |
| DisplayFileName { get; set; } | |
| DropHint { get; set; } | The text of the drop box of the editor while it has no file, in place of "Drop a file here or click to choose", as a text or a local text key. |
| DropHintDetail { get; set; } | A line under the text of the drop box, e.g. the kind or the size of the files, as a text or a local text key. |
| FilenameFormat { get; set; } | |
| IgnoreEmptyImage { get; set; } | |
| IgnoreExtensionMismatch { get; set; } | |
| IgnoreInvalidImage { get; set; } | |
| ImageExtensions { get; set; } | |
| abstract IsMultiple { get; } | |
| JsonEncodeValue { get; set; } | |
| MaxHeight { get; set; } | |
| MaxSize { get; set; } | |
| MaxWidth { get; set; } | |
| MinHeight { get; set; } | |
| MinSize { get; set; } | |
| MinWidth { get; set; } | |
| OriginalNameProperty { get; set; } | |
| ScaleBackColor { get; set; } | |
| ScaleHeight { get; set; } | |
| ScaleMode { get; set; } | |
| ScaleQuality { get; set; } | |
| ScaleSmaller { get; set; } | |
| ScaleWidth { get; set; } | |
| ThumbBackColor { get; set; } | |
| ThumbHeight { get; set; } | |
| ThumbMode { get; set; } | |
| ThumbQuality { get; set; } | |
| ThumbSizes { get; set; } | |
| ThumbWidth { get; set; } | |
| Toolbar { get; set; } | Whether the editor shows its toolbar with the select file button, as it did before, instead of a drop box while it has no file and buttons by its files. When not set, the editor shows it only when its toolbar has buttons of its own, see FileUploadEditor.defaults and MultipleFileUploadEditor.defaults on the client. |
| UploadIntent { get; set; } |
Protected Members
| name | description |
|---|---|
| BaseUploadEditorAttribute(…) | Sets editor type as "ImageUpload", which only allows image files. Make sure you use this attribute in Row.cs, not Form.cs as the image upload behavior only works if it is in the row, otherwise your files will stay in the temporary directory. |
Remarks
Initializes a new instance of the BaseUploadEditorAttribute class.
See Also
- class CustomEditorAttribute
- interface IUploadEditor
- interface IUploadFileConstraints
- interface IUploadFileOptions
- interface IUploadImageConstraints
- interface IUploadImageOptions
- Source: BaseUploadEditorAttribute.cs