Image upload field.
NOTE: How to use, see example.
Constructors
new(label :
String = "", default :
String |
Nil = nil, placeholder :
String = "", target_dir :
String = "images", thumbnails :
Array(
Tuple(
String,
Int32)) |
Nil = nil, maxsize :
Int64 = 2097152, hide :
Bool = false, required :
Bool = false, disabled :
Bool = false, readonly :
Bool = false, ignored :
Bool = false, hint :
String = "", warning :
Array(
String) =
Array(
String).new)
SourceInstance methods
accept
HTML attribute: accept.
NOTE: Describing which file types to allow.
NOTE: Example: "image/png,image/jpeg,image/webp"
NOTE: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept#unique_file_type_specifiers
Sourcedefault
Default file path.
NOTE: Example: "public/media/default/noavatar.jpg"
Sourcedefault?
Default file path.
NOTE: Example: "public/media/default/noavatar.jpg"
Sourcefield_type
Field type - Structure Name.
Sourcefrom_base64(base64 :
String |
Nil = nil, filename :
String |
Nil = nil, delete :
Bool = false) :
Nil Convert base64 to a image and save in the target directory.
filename: Example: foo.pdf
Sourcefrom_path(path :
String |
Nil = nil, delete :
Bool = false) :
Nil Convert path to a image and save in the target directory.
Sourcegroup
To optimize field traversal in the paladins/check() method.
WARNING: It is recommended not to change.
Sourcemaxsize
The maximum allowed image size in bytes.
NOTE: 1 MB = 1048576 Bytes (in binary).
Sourcereadonly=(readonly :
Bool)
Specifies that the field cannot be modified by the user.
Sourcereadonly?
Specifies that the field cannot be modified by the user.
Sourcerefrash_val_img_data(val : DynFork::Globals::ImageData) : Nil
For the DynFork::QPaladins::Tools#refrash_fields method.
Sourcetarget_dir
Directory for images inside media directory.
NOTE: Examples: avatars|photos|images
Sourcethumbnails
From one to four inclusive.
NOTE: Example: [{"xs", 150}, {"sm", 300}, {"md", 600}, {"lg", 1200}]
Sourcethumbnails?
From one to four inclusive.
NOTE: Example: [{"xs", 150}, {"sm", 300}, {"md", 600}, {"lg", 1200}]
Sourcevalue
Sets the value of an element.
Sourcevalue=(value : DynFork::Globals::ImageData | Nil)
Sets the value of an element.
Sourcevalue?
Sets the value of an element.
Source