Display original file name

Is there a way to display the name of the file attached to an item? I am looking for a piece of code to insert inside the show.phtml.

I means the name of the physical file (pdf for example) when it was uploaded to Omeka S (not the title of this media in Omeka S and not either the generic name created in /files).

The original upload title is available as $media->source()

We typically use displayTitle() which will show the set title property, if there is one, or the original filename/URL if there isn’t. But if as you say you want the filename specifically and never the title, then source is the way to go.

1 Like

Thanks! …