Work with uploaded media
A media resource has ordinary content properties and information about its associated file. Use model#media to inspect and manipulate media through Zotonic's normal processing path.
A media resource has ordinary content properties and information about its associated file. Use model#media to inspect and manipulate media through Zotonic's normal processing path.
Keep the archive file and generated previews separate in your reasoning. A missing preview can be a processing problem even when the original upload is present. Check the file's media type, processing status, and storage configuration before replacing the resource.
Use media APIs for replacement and deletion so derived files and notifications remain consistent. Do not construct archive filenames from titles. See Display images with mediaclasses, Configure persistent file storage, and An uploaded image does not display.