Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown mime-Type for .msg Files #3543

Closed
katuss opened this issue Feb 1, 2019 · 7 comments
Closed

Unknown mime-Type for .msg Files #3543

katuss opened this issue Feb 1, 2019 · 7 comments
Labels
bug needs info Waiting for info from user(s). Issues with this label will auto-stale.

Comments

@katuss
Copy link

katuss commented Feb 1, 2019

Actual behaviour

  • When I open a .msg file with any MSG viewer it works fine. But as soon as I open the Nextcloud Android App with the "open with" function I use the Viewer App was not listed.

Expected behaviour

  • in the nextcloud android app I open a .msg file. I use Open with > Viewer App > Done

Steps to reproduce

  1. Download Android NC App & and any .msg file compatible viewer app. as example: https://play.google.com/store/apps/details?id=com.sharpened.androidfileviewer

  2. try to open a .msg file from the nextcloud app.

  3. try to open a .msg file from the viewer app.

Environment data

Android version: 8.0 / 8.1 / 9

Device model: SM-A530x / SM-G39F / BKL-L09

Stock or customized system: Manufacturer unchanged (Samsung / Huawei)

Nextcloud app version: 3.4.2

Nextcloud server version: 14.0.6

Answer from a Fileviewer Dev Support:

The reason for this issue is technical and has to do with the source app you’re trying to open the .msg files from. A short explanation is below. We are working on a solution for this for a future version of File Viewer for Android.

If the app you’re trying to open the file from asks to open an “application/vnd.ms-outlook” file, then File Viewer will be shown as an open option because this is the correct MIME type for the file. However, it’s more likely that your app is requesting that a generic “application/octet-stream” byte stream be opened because it does not correctly identify the MIME type. In this case, File Viewer does not display as an open option because “application/octet-stream” is not specific.

@katuss katuss added the bug label Feb 1, 2019
@nextcloud-android-bot
Copy link
Collaborator

GitMate.io thinks possibly related issues are #2049 (Autoupload only works for image file types), #3174 (Grid view: file type icons smaller), #455 (Better emptycontent view for file types which can not be shown), #558 (File search), and #3033 (Quickfix for unknown SharingTypes).

@tobiasKaminsky
Copy link
Member

We are relying on Android to detect the correct mimetype:

String guessedMimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExt);

But this fails for "msg" and thus it is opened by any app that can handle octet-stream.
While we could try to mantain our own mimetype map, the main fix would be that Android can detect msg properly…

@katuss
Copy link
Author

katuss commented Feb 4, 2019

I also reported the problem to Google issuetracker.
https://issuetracker.google.com/issues/123737754

I hope this gets fixed fast.
In the meantime I am grateful for suggestions and workarounds.

@15characterlimi
Copy link

15characterlimi commented Feb 4, 2019

I've commented on the bug on the Google issue tracker too, but basically I don't think it's clear why you need any change of Android's behavior at all. My understanding is that it should be sufficient to use the file extension to recognize those files. Your app (Nextcloud for Android) should make sure that the Uri for your VIEW Intent ends with the correct file extension so that viewers can recognize it.

Also, you haven't specified which MIME type you consider to be correct for .msg files and why you consider that to be correct. An RFC would be great, but I couldn't find an RFC that specified a correct MIME type for .msg files. Upstream mime-support also doesn't have a mapping for .msg files:
https://salsa.debian.org/debian/mime-support/blob/master/mime.types

@tobiasKaminsky
Copy link
Member

My understanding is that it should be sufficient to use the file extension to recognize those files.

We are doing this, but as said Android does not handle .msg. So we (and maybe hundreds of other apps) need to handle this on their own.

@tobiasKaminsky
Copy link
Member

Can you give this a try?
This is working for me with latest NC app and Android 10.

@tobiasKaminsky tobiasKaminsky added needs info Waiting for info from user(s). Issues with this label will auto-stale. and removed approved labels Mar 11, 2020
@AndyScherzinger
Copy link
Member

Also tested it with Android 9 and working jsut fine offering the mentioned app for .msg files. So closing the issue. Please feel free to comment and re-open in case the issue persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs info Waiting for info from user(s). Issues with this label will auto-stale.
Projects
None yet
Development

No branches or pull requests

5 participants