These steps help with adding new mimetypes.

Either add this as a new file type or update an existing file type by appending the mime type application/zip

Step one: add / update existing file types

Admin » Structure » File types » Add file type

Field 1: Zip

Field 2: zip files

Field 3: application/zip

Save

Step two: Ensure zip is included as one of the "Default allowed file extensions"

But after that I had to also to the list of accepted file extensions to "Default allowed file extensions"

Home » Administration » Configuration » Media » File settings

add zip to the list if it is not already present.

Original report by Aptalops

Hi, contragtulations on Open Atrium 2.0, it's great.

I am building a document library using the news section and adding files as attachments to document pages. Apart from the error message 'An illegal choice has been detected...' which crops up occasionally (I see there's another thread on this), it works well.

However, I would like to introduce some new file types as my document library is actually a Visual Identity - e.g. I need to add some logos in eps format. This is a summary:

1. I go to Home » Administration » Structure » Content types » Document Page » Manage fields » Attachments

2. I add eps and zip to the field "Allowed file extensions for uploaded files *

3. I go back to my Document page » Edit » Attachments » Select » Choose file (I choose an eps file) » Upload » Next.

4. This is where I get stuck - the next box asks me to 'Select a file', File type*. There are no options to choose from or fields to fill in. I clicked on 'Next' an error message says 'File type required' (see attached screenshot).

How do I proceed?

Thanks for any suggestions,

A~

p.s. also added the file extensions I need i.e. eps & zip to Home » Administration » Configuration » Media » Media browser settings, but still no luck

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Aptalops’s picture

Issue summary: View changes
mpotter’s picture

I believe for the new Media module that uses file entities, you need to update the MIME list here: admin/structure/file-types/manage/document/edit

Aptalops’s picture

Thanks so much for your reply mpotter - unfortunately, after attempting, then doing some more searching on drupal.org, and attempting again - the cms won't allow me to add any extension to the MIME list you pointed me towards. Even a simple image/jpg entry (jpeg is already in the list but not jpg) to the image file type (admin/structure/file-types/manage/image) gives the error "The mimetype image/jpg is not a valid mimetype."
Perhaps this is not the correct way to update the mimetype list?
Thanks again for any further thoughts...
A~

Aptalops’s picture

Category: Support request » Bug report
Aptalops’s picture

Hi, I was on the OA 2.0 webinar yesterday and posed the question above but it was deemed too specific for the webinar (it probably was...), and better posed on the issue queue. So, just bumping this discussion to see if anyone has any tips for achieving the objective of allowing file types other than the preset list. Also changed the issue from 'support request' to 'bug' as it seems to me that mpotter's suggestion above should have been the solution but any update gives the error "The mimetype */* is not a valid mimetype."
Thanks everyone,
A~

Argus’s picture

Priority: Major » Normal
Argus’s picture

Version: 7.x-2.04 » 7.x-2.12
Status: Active » Postponed (maintainer needs more info)

Does this still occur?

Aptalops’s picture

Yes, this does still occur exactly as originally described. Point 4 above is still where I get stuck - the next box asks me to 'Select a file', File type*. There are no options to choose from or fields to fill in. I click on 'Next' and an error message appears saying: 'File type required' (see attached screenshot above).

This functionality is really crucial for me as my client, and I would assume many other users (hence my original categorization of the problem as major), needs a document library (i.e. news section) that can at least store a simple PowerPoint file (.ppt) as an attachment.

Some more detail: I have added the extensions eps & zip to Home » Administration » Configuration » Media » Media browser settings, but not ppt. Then when I try to upload a ppt file as an attachment, the following message appears:
The selected file example.ppt cannot be uploaded. Only files with the following extensions are allowed: zip, eps, gif, png, jpg, jpeg, pdf, doc, docx, xls, xlsx, txt.
Which shows that the zip and eps are now listed as allowed extensions, even though they still cannot be uploaded. If I add ppt, I run into the original 'Select a file' loop described in the original post.

Any help greatly appreciated,
thank you
A~

Argus’s picture

Status: Postponed (maintainer needs more info) » Active
bigals’s picture

Aptalops - please could you try this in order to upload a zip file (as it worked for me)?

Admin>Structure>File types>Add file type
Field 1: Zip
Field 2: zip files
Field 3: application/zip
Save

Thanks and good luck.

Kudos to Open Atrium developers and product.

stewstate’s picture

If this helps, navigating to admin/structure/types/manage/oa-wiki-page/fields/field_oa_media and entering an additional file extension in the list of "Allowed file extensions for uploaded files" allowed an upload of the new extension.

dar1962’s picture

I had to be able to upload a powerpoint .pptx file type to a document page and I followed the steps in post #11 and added pptx to the Allowed file extensions for uploaded files values and this worked.

Argus’s picture

Status: Active » Closed (works as designed)

OK, closing then. No activity and this seems to work for most people. @Aptalops: please reopen as a support question if needed.

bigals’s picture

I just ran across a special case so thought that I'd it here in case it helps others.

Occasionally you might want to add a file type that is not included in the mime filetypes, such as an 'ini' file, or perhaps a file type extension that is internal and so not publicly recognized.

In this case we have the same problem (where it needs to be added) but also a new problem where the mimetype doesn't appear in the list of available mimetypes and so files ending 'ini' cannot be added.

For me the solution was to edit openatrium/includes/file.mimetypes.inc and add 2 new rows, one to each array. In my case:
Added to first array (called mimetypes):
1000 => 'text/ini',
Added to second array (called extensions):
'ini' => 1000,

Now I could add the 'text/ini' file type as in Step 10, Field 3 above and so upload 'ini' file types to my open atrium installation .

maxplus’s picture

Hi,

just to add here for others:

I was looking for a way to add an .eps file as attachment.
In the default includes/file.mimetypes.inc I found that the eps extension is linked to "22 => 'application/postscript',"

So just add "application/postscript" in the mimetypes list at "admin/structure/file-types/manage/document/edit" and you can add as .eps file as Document!

To pass the first Media-browser upload button, you should also add .eps to the allowed file extension at "admin/config/media/file-settings"

Adam Fermier’s picture

Thanks bigals #14 worked for me - added in ability to load microsoft email messages (application/vnd.ms-outlook msg) - following those instructions followed by clearing cache enabled this filetype to be added.

rschaeffler’s picture

These steps help with adding the mimetype,
Admin>Structure>File types>Add file type
Field 1: Zip
Field 2: zip files
Field 3: application/zip
Save

But after that I had to also add 'zip' (without the comma or dot) to the list of accepted file extensions to "Default allowed file extensions"

Home » Administration » Configuration » Media » File settings

Alan D.’s picture

Issue summary: View changes

Updated with rschaeffler notes for ease of finding the complete solution rather than parsing the entire thread.

apaderno’s picture

I am clearing the content of the files added by the spammer.

apaderno’s picture

(It seems the files aren't cleared if I don't submit a new comment, after I am redirected to the comment create form.)

apaderno’s picture

mennonot’s picture

For me in Drupal 8, in addition to the steps outlined in comment #15 above (adding application/postscript to the mimetype list) there was an additional step of adding eps (or zip) as an acceptable file type for the entity browser. Instructions:

1. Go here: admin/config/content/entity_browser
2. Click the edit button for the entity browser of your choice.
3. Click next button five times or until you reach a page with a table including an "Operations" column.
4. In the operations column you should see a "Allowed file extensions" field. Add "eps" (no comma or period) to the end of this list.
5. Click the next button to save your changes.

Repeat these steps as needed for other entity browsers in the list.