pawelrojek / nextcloud-drawio

Draw.io intergration app
https://apps.nextcloud.com/apps/drawio
GNU Affero General Public License v3.0
227 stars 60 forks source link

MIME type definition could be outdated #99

Open EchedelleLR opened 4 years ago

EchedelleLR commented 4 years ago

I followed theses steps, https://github.com/pawelrojek/nextcloud-drawio#mimetype-detection, after disabling *.xml files with draw.io by default and it is not working for me in Nextcloud 17.

I am using the docker container edition and I already updated mimetypes and confirmed that permissions and location of the file are corrected.

marshalleq commented 4 years ago

Me too.

marshalleq commented 4 years ago

This would appear to be more useful in understanding how to resolve. https://docs.nextcloud.com/server/11/admin_manual/configuration_mimetypes/index.html

EchedelleLR commented 4 years ago

I checked that confiuration but seems to be for an outdated Nextcloud version. I tried changing the definition a lot unsuccessfully.

danaivehr commented 4 years ago

Finally i get it: After adding your mimetype you need to do occ maintenance:mimetype:update-db

Working on nc 18. For some reason there is no any notice how to update mimetype database, there is only the notice how to update mimetype aliases with maintenance:mimetype:update-js It may be that in some setups mimetype database updates some other way so that not all are facing this issue. I'm using docker linuxserver image for nextcloud.

So the complete how-to for adding mimetypes is:

  1. update (or create if does not exists) /config/mimetypemapping.json with "drawio": ["application/x-drawio"] so that it looks like
{
        "drawio": ["application/x-drawio"]
}
  1. run sudo -u abc php occ maintenance:mimetype:update-db from nextcloud root directory
  2. wait while mime database updates
  3. enjoy
EchedelleLR commented 4 years ago

Finally i get it: After adding your mimetype you need to do occ maintenance:mimetype:update-db

Working on nc 18. For some reason there is no any notice how to update mimetype database, there is only the notice how to update mimetype aliases with maintenance:mimetype:update-js It may be that in some setups mimetype database updates some other way so that not all are facing this issue. I'm using docker linuxserver image for nextcloud.

So the complete how-to for adding mimetypes is:

  1. update (or create if does not exists) /config/mimetypemapping.json with "drawio": ["application/x-drawio"] so that it looks like
{
        "drawio": ["application/x-drawio"]
}
  1. run sudo -u abc php occ maintenance:mimetype:update-db from nextcloud root directory
  2. wait while mime database updates
  3. enjoy

I already tried that in NC 17 without getting nothing. I will try again but I think it will be the same.

UPDATED: sorry, I didn't read your post at all. You meant the mimetype-db. I didn't see any reference about it in any forum I visited nor documentation as you reference. I will try later.

EchedelleLR commented 4 years ago

@danaivehr It seems that doesn't add the custom alias.

UPDATED: I recognize that the first time I tried it I saw some other aliases being added and now just show that there are no new aliases to be added. So, at least, I know that could work.

The thing is, I am not sure if its because I tried "/config/mimetypealiases.json" instead of "/config/mimetypemapping.json".

UPDATED-2: Okay I checked https://docs.nextcloud.com/server/18/admin_manual/configuration_mimetypes/index.html and I think I am truly stupid sometimes.

UPDATED-3: Okay, seems that was recognized.

melalandia@debian-minipc:~$ docker exec --user www-data 07577e3d010c php occ maintenance:mimetype:update-db
Added mimetype "application/x-drawio" to database
Added 1 new mimetypes
Updated 0 filecache rows
EchedelleLR commented 4 years ago

It worked in the end. Thank you @danaivehr.

In conclusion, bold characters for the names could be great as it got me confused with the name the first times.