Jump to content

Base64 field: Difference between revisions

From EPrints Documentation
Added base64 field page
 
Actually leave in as not redirect
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{fieldtypes}}
{{fieldtypes}}
__NOTOC__
 
 
== Description ==
This field store Base64 encoded data.  This may be useful for storing the binary data of small files (e.g. logos, avatars, etc.).
 
== Inheritance ==
== Inheritance ==
* [[:Category:EPrints_Metadata_Fields|Metadata field]]
** [[Id field]]
*** [[Text field]]
**** [[Longtext field]]
***** [[Base64 field]]
== Additional Properties ==
As for [[Longtext field#Additional_Properties|Longtext fields]].


* [[:Category:EPrints_Metadata_Fields|Metadata field]]
== Required Phrases ==
** [[Text field]]
No additional phrases beyond those required for [[Longtext field#Required_Phrases|Longtext fields]].
*** [[Longtext field]]
**** [[Base64 field]]


== Description ==
== Database ==
Base64 fields are stored in the database as
  fieldname LONGTEXT


== Properties ==
== API ==
See [[API:EPrints/MetaField/Base64|API page]].


As for [[text field]]s with the following differences...
== Examples ==
Most basic example.
{
    name => 'base64_data',
    type => 'base64',
}


{| border="1" cellpadding="3" cellspacing="0"
Limit the maximum size of file data that can submitted to 2 MiB.
| name || default || description
{
|-
    name => 'file_data',
| '''input_rows''' || n/a || '''This property is taken from the repository configuration.'''
    type => 'base64',
|-
    maxlength => '2097152',
| '''maxlength''' || 65535 || '''Can be overridden in the field definition.'''
}
|}


== Required Phrases ==
Displayed <tt><textarea></tt> should have a height of five rows for entering this metadata.
{
    name => 'code',
    type => 'base64',
    input_rows=> '5',
}

Latest revision as of 09:45, 9 July 2024


Description[edit]

This field store Base64 encoded data. This may be useful for storing the binary data of small files (e.g. logos, avatars, etc.).

Inheritance[edit]

Additional Properties[edit]

As for Longtext fields.

Required Phrases[edit]

No additional phrases beyond those required for Longtext fields.

Database[edit]

Base64 fields are stored in the database as

 fieldname LONGTEXT

API[edit]

See API page.

Examples[edit]

Most basic example.

{
   name => 'base64_data',
   type => 'base64',
}

Limit the maximum size of file data that can submitted to 2 MiB.

{
   name => 'file_data',
   type => 'base64',
   maxlength => '2097152',
}

Displayed <textarea> should have a height of five rows for entering this metadata.

{
   name => 'code',
   type => 'base64',
   input_rows=> '5',
}