]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/plugins/attachment.mdwn
add mimetype checking
[ikiwiki.git] / doc / plugins / attachment.mdwn
index 184f5b5df55f2a71b1fa53281d8f931d16d45ee0..01816cd5c70d9d51b9f29f20d4b10bc91f958f00 100644 (file)
@@ -29,7 +29,7 @@ For example, to limit arbitrary files to 50 kilobytes, but allow
 larger mp3 files to be uploaded by joey, a test like this could be
 used:
   
-       (user(joey) and *.mp3 and maxsize(15mb)) or (!ispage() and maxsize(50kb))
+       (user(joey) and *.mp3 and mimetype(audio/mpeg) and maxsize(15mb)) or (!ispage() and maxsize(50kb))
 
 The following additional tests are available:
 
@@ -62,3 +62,9 @@ The following additional tests are available:
 
   Tests whether the attacment is being uploaded from the specified IP
   address.
+
+* mimetype(foo/bar)
+
+  If the [[cpan File::MimeInfo::Magic]] perl module is installed, this
+  allows checking the mime type of the attachment. You can include a glob
+  in the type, for example `mimetype(image/*)`.