Modulify

Read a stored file

read_storage_file

Returns the contents of one stored file, base64 encoded.

The bytes arrive base64 encoded in a content field alongside the content type and size, so decode them before use. Pass the full key exactly as list_storage_files returned it.

Files over 5 MB are refused with a 413, but the practical limit is far lower. A tool result is cut off at 60,000 characters and base64 inflates by a third, so any file larger than about three quarters of that many bytes comes back truncated and will not decode. Use it for small text, JSON, CSV and SVG files, and get_storage_file_url for anything bigger.

It reads the CMS folder at the top level like any other folder, and keeps working while a storage backup is being restored. See The CMS folder.

Inputs

Input Type Required Description
projectId string Yes The site id.
key string Yes The full key of the file, from list_storage_files.