0

I have many PDF documents in my site, assigned to the Document File Type by the File Entity Module.

I have added a few fields to the content type, thus allowing nice interface in showing all PDF files on the site, with nice filtering.

Now I want to include Zip archives in this interface. (Zip archives are not by default added to any Document type). I have updated the Document type definition to include the mime type application/zip on this page: /admin/structure/file-types/manage/document/edit

Is there any way I can automatically update the existing zip archive files so they are assigned to the Document File Type? As mentioned, there are quite a lot of them and I'd prefer not to have to upload them all again.

  • admin/structure/file-types? Thats not Drupal core, right? You must be using a module for this - would be useful to know what module it is. It's also unclear what you want - is there some sort of admin page with an overview of all files, and you want the zip files to show up there? – Jeff Burnz Aug 17 '16 at 16:05
  • Jeff, you are correct, I didn't realise this isn't part of core (I didn't build the site originally and it's big and complex). The relevant module is File Entity drupal.org/project/file_entity – James Aug 17 '16 at 16:14
  • With regards to what I want, I want zip archives to be defined as the Documents File Type. – James Aug 17 '16 at 16:16
0

If I understand correct and it is only an interface / layout issue, I suggest creating a view of that file with views and then put it in a block under the node and filter the block with content type and/or node conditions (or to put the block inside a paragraph layout piece).

If you mean you want the zip files to be in the also considered by Drupal as a Document file type so it would appear together with the PDF than what I suggest is to see how the module you use categorizes PDF files and then initiate this same code-level categorization to the PDF, for example, by adding the file extension PDF to the list of allowed extensions if there is one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.