DynFork::Fields::FileField
Inherits DynFork::Fields::Field < JSON::Serializable < Struct < Value < Object
File upload field. NOTE: How to use, see example.
Constructors
new(pull : JSON::PullParser)
Sourcenew(label : String = "", default : String | Nil = nil, target_dir : String = "files", accept : String = "", placeholder : String = "", 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: ".pdf,.doc,.docx,application/msword" NOTE: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept#unique_file_type_specifiers
from_base64(base64 : String | Nil = nil, filename : String | Nil = nil, delete : Bool = false) : Nil
Convert base64 to a file and save in the target directory.
NOTE: filename Example: foo.pdf
Convert path to a file and save in the target directory.
group
To optimize field traversal in the paladins/check() method.
WARNING: It is recommended not to change.
refrash_val_file_data(val : DynFork::Globals::FileData) : Nil
For the DynFork::QPaladins::Tools#refrash_fields method.