Skip to the content
Documentation

The BinaryFile FieldType: old version (page id 16286169)

No ratings yet

BinaryFile

Field type which represents and handles a binary file. It also counts the number of times the file has been downloaded from the content/download module.

 

Name Internal name Expected input Output
BinaryFile ezbinaryfile Mixed Mixed

Description

This FieldType allows the storage and retrieval of a single file. It is capable of handling virtually any file type and is typically used for storing legacy document types such as PDF files, Word documents, spreadsheets, etc. The maximum allowed file size is determined by the "Max file size" class attribute edit parameter and the "upload_max_filesize" directive in the main PHP configuration file ("php.ini").

API

downloadCount

 Type: integer

Stores the number of times the file was downloaded.

id

Type: string

Binary file identifier. This ID depends on the IO Handler that is being used. With the native, default handlers (FileSystem and Legacy), the ID is the file path, relative to the web root, within the var folder (var/ezdemo_site/storage/original/...).

fileName

Type: string

The actual, physical file name, as exposed to the outside. Used when sending the file for download in order to name the file.

fileSize

Type: integer

The size of the file, in bytes.

mimeType

Type: string

The file's mime type, e.g. application/pdf, text/plain...

uri

Type: string

The binary file's HTTP uri.  How this value is built depends on each IO handler.

path (deprecated)

Type: stringRenamed to id starting from Exponential 5.2. Can be used instead of id, but it is better not to use it anymore.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.