Under the “Allowed File Types” in the admin panel, the only uptions are “images” and “all file types”. Is there a way that I can have more control over which file types I want people to upload? i.e. only PDF files, or only DOC files?
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
September 21, 2007 1:47am
Subscribe [3]#1 / Sep 21, 2007 1:47am
Under the “Allowed File Types” in the admin panel, the only uptions are “images” and “all file types”. Is there a way that I can have more control over which file types I want people to upload? i.e. only PDF files, or only DOC files?
#2 / Sep 21, 2007 8:20am
Under the “Allowed File Types” in the admin panel, the only uptions are “images” and “all file types”. Is there a way that I can have more control over which file types I want people to upload? i.e. only PDF files, or only DOC files?
From the docs:
Note: Only file types that are specified in ExpressionEngine’s Mime Type file are allowed to be uploaded. If you are uploading something uncommon and run into problems you may need to add the mime type for your file. The Mime Type file can be found at: system/lib/mimes.php
I’m sure if you edit mimes.php you can allow/disallow certain file types. Make a backup of the original mimes.php file just to be sure.
#3 / Sep 21, 2007 10:00am
Hmm… I haven’t looked at the file yet, but will later this evening. I wonder if that will do what I want… For example, when I create a new upload directory, I want only PDF’s allowed to be uploaded - so only .pdf files.
Take for example, my wiki. I created an upload directory - wiki_uploads. Ine admin panel I have only the choice of letting people upload image files, or ALL types of files. I don’t want people randomly uploading .mp3’s. I’m on a university server, and they would really frown upon that. So, I want to limit their uploads to only .doc, .pdf, and .xls files. I’m not sure if the Mime Type file will accomplish that for me. I will give it a look tonight, and I’ll find out.
Thanks for your help!