⧼vector-jumptocontent⧽

Base64 field: Difference between revisions

From EPrints Documentation
m Spacing after ToC
Actually leave in as not redirect
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{fieldtypes}}
{{fieldtypes}}


== 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]]
* [[:Category:EPrints_Metadata_Fields|Metadata field]]
** [[Text field]]
** [[Id field]]
*** [[Longtext field]]
*** [[Text field]]
**** [[Base64 field]]
**** [[Longtext field]]
 
***** [[Base64 field]]
== Description ==
Base64 encoded data.
 
== Properties ==
 
As for [[text field]]s with the following differences...


{| border="1" cellpadding="3" cellspacing="0"
== Additional Properties ==
| name || default || description
As for [[Longtext field#Additional_Properties|Longtext fields]].
|-
| '''input_rows''' || n/a || '''This property is taken from the repository configuration.'''
|-
| '''maxlength''' || 65535 || '''Can be overridden in the field definition.'''
|}


== Required Phrases ==
== Required Phrases ==
No additional phrases.
No additional phrases beyond those required for [[Longtext field#Required_Phrases|Longtext fields]].


== Database ==
== Database ==
Line 32: Line 23:


== API ==
== API ==
''To be added''
See [[API:EPrints/MetaField/Base64|API page]].


== Examples ==
== Examples ==
A basic example.
Most basic example.
  {
  {
     name => 'base64_data',
     name => 'base64_data',

Latest revision as of 09:45, 9 July 2024


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

Additional Properties

As for Longtext fields.

Required Phrases

No additional phrases beyond those required for Longtext fields.

Database

Base64 fields are stored in the database as

 fieldname LONGTEXT

API

See API page.

Examples

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',
}