File Functions

These functions let you add documents or pictures into the CMS, then display documents and pictures that are stored in the CMS.

Calling File Functions

You can use syntax of the form:

functionName()

to call these functions in your PHP code.

addFileFromString()

Name in Zenario 8

ze\file::addFromString()

This function lets you add a file to the database by passing the file's contents in as a string.

addFileToDatabase()

Name in Zenario 8

ze\file::addToDatabase()

You can add a new file into the files table of the CMS using this function.

addFileToDocstoreDir()

Name in Zenario 8

ze\file::addToDocstoreDir()

A shortcut to the addFileToDatabase() core function, which always tries to add a file to the docstore directory if possible.

addImageDataURIsToDatabase()

Name in Zenario 8

ze\file::addImageDataURIsToDatabase()

This allows you to take some HTML content, strip any data URIs out, add them to the CMS as files in the database, then replace them in the HTML with normal links to those files.

checkDocumentTypeIsAllowed()

Name in Zenario 8

ze\file::isAllowed()

Checks to see if a file type is recognised by the CMS.