Restrict certain attachment file types


#1

Is there a way in RT to restrict the attachments based on file type in the Web UI? Currently it is possible to upload exe files to tickets which is not what we want.


#2

Hi Deepak,

you should be able to create a scrip that check the attachment upon ticket creation by using RT::Attachment and the object’s ContentType. I haven’t tried and I don’t have the recipe though.

I also found a warning in the module description:
This module should never be instantiated directly by client code. it’s an internal module which should only be instantiated through exported APIs in Ticket, Queue and other similar objects.

For sure the attachment type is stored in the DB in table attachments:
select distinct(contenttype) from attachments limit 10;
contenttype

text/directory
multipart/mixed
text/xml
text/rtf
application/x-compressed-tar
application/acrobat
other/pdf
image/gif
audio/mpeg
application/x-ms-download
(10 rows)

Cheers,
Sam