struct

DynFork::Fields::FileField

Inherits DynFork::Fields::Field < JSON::Serializable < Struct < Value < Object

File upload field. NOTE: How to use, see example.

Constructors

new(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)
Source

Instance 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

Source
default

Default file path. NOTE: Example: "public/media/default/nodoc.docx"

Source
default?

Default file path. NOTE: Example: "public/media/default/nodoc.docx"

Source
extract_file_data

For the DynFork::QPaladins::Check#check method.

Source
extract_file_path

For the DynFork::QPaladins::Check#check method.

Source
field_type

Field type - Structure Name.

Source
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

Source
from_path(path : String | Nil = nil, delete : Bool = false) : Nil

Convert path to a file and save in the target directory.

Source
group

To optimize field traversal in the paladins/check() method. WARNING: It is recommended not to change.

Source
input_type

Html tag: input type="file".

Source
input_type?

Html tag: input type="file".

Source
maxsize

The maximum allowed file size in bytes. NOTE: 1 MB = 1048576 Bytes (in binary).

Source
media_root

Root directory for storing media files.

Source
media_url

URL address for the media directory.

Source
placeholder

Displays prompt text.

Source
readonly=(readonly : Bool)

Specifies that the field cannot be modified by the user.

Source
readonly?

Specifies that the field cannot be modified by the user.

Source
refrash_val_file_data(val : DynFork::Globals::FileData) : Nil

For the DynFork::QPaladins::Tools#refrash_fields method.

Source
required?

Required field.

Source
target_dir

Directory for files inside media directory. NOTE: Examples: files|resume|reports

Source
value

Sets the value of an element.

Source
value=(value : DynFork::Globals::FileData | Nil)

Sets the value of an element.

Source
value?

Sets the value of an element.

Source