Simple module to add base64 string data methods to SilverStripe files and images

Installs: 21

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 1


1.0.1 2024-06-08 12:20 UTC

This package is auto-updated.

Last update: 2024-07-08 12:30:30 UTC


SilverStripe File Base64

Simple SilverStripe module to generate a Base64 encoded string of File or Image data that can be used in image tags, etc.


Install via composer:

composer require dft/silverstripe-file-base64


This module automatically adds two methods to files and images that allow accessing the data string:

NOTE: Currently the following methods will only return a data string of the base image NOT a modified image (for example using Image methods like Fill or Fit)


Returns the base 64 encoded string of the file/image data. For example, in a template you can call:



Returns a Data URL that can be used in image tags, links etc. To use it in templates you can call:

<img src="$Image.Base64DataURL">