Getting files by MIME type

12 views
Skip to first unread message

Jeremy Boggs

unread,
Sep 30, 2012, 10:44:29 AM9/30/12
to omek...@googlegroups.com
Hi folks,

For a plugin I'm writing, I had the need to return files for an item that were a certain kind: PDF, HTML, XML, Word, RTF, and plain text. I wrote a function to do this, but am curious if this is the best way to go about this. The function is in a gist:


It relies on checking the mime_browser field in the Files table, and builds a select statement to find files with a mime_browser LIKE the mime types I wanted.

I wrote this for Omeka 1.5, and it does what I need it to do, but if there's room for improvement, I'd love to hear it. Also curious if there will be better ways to do this in 2.0.

Thanks!
Jeremy
Reply all
Reply to author
Forward
0 new messages