z_media_archive (zotonic_core v1.0.0-rc.11)

Media archiving utilities. Manages the files/archive directory of sites.

Link to this section Summary

Functions

Return the absolute path name of a relative file in the archive
Always archive a copy of a file in the archive directory
Optionally archive a copy of a file in the archive directory (when it is not archived yet)
Delete a filename in the archive
Move a file to the archive directory (when it is not archived yet)
Move a file to the archive directory (when it is not archived yet)
Ensure that the filename is relative to the archive. When needed move the file to the archive. Return the relative path.
Check if the file is archived (ie. in the archive directory)
Remove the path to the archive directory, return a filename relative to the archive directory

Link to this section Functions

Link to this function

abspath(File, Context)

Return the absolute path name of a relative file in the archive
Link to this function

archive_copy(Filename, Context)

Always archive a copy of a file in the archive directory
Link to this function

archive_copy(Filename, NewBasename, Context)

Link to this function

archive_copy(_, Filename, NewBasename, Context)

Link to this function

archive_copy_opt(Filename, Context)

Optionally archive a copy of a file in the archive directory (when it is not archived yet)
Link to this function

archive_copy_opt(Filename, NewBasename, Context)

Link to this function

archive_delete(Filename, Context)

Delete a filename in the archive
Link to this function

archive_file(Filename, Context)

Move a file to the archive directory (when it is not archived yet)
Link to this function

archive_file(Filename, NewBasename, Context)

Move a file to the archive directory (when it is not archived yet)
Link to this function

archive_filename(Filename, Context)

Link to this function

ensure_relative(File, Context)

Ensure that the filename is relative to the archive. When needed move the file to the archive. Return the relative path.
Link to this function

ensure_relative(File, NewBasenameIfMoved, Context)

Link to this function

is_archived(Filename, Context)

-spec is_archived(file:filename_all(), z:context()) -> boolean().
Check if the file is archived (ie. in the archive directory)
Link to this function

preview_filename(Filename, Context)

Link to this function

rel_archive(Filename, Context)

Remove the path to the archive directory, return a filename relative to the archive directory
Link to this function

safe_filename(B)