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

Matlab source files not opened as text files #2081

Closed
zingmars opened this issue Jan 31, 2018 · 13 comments · Fixed by #4434
Closed

Matlab source files not opened as text files #2081

zingmars opened this issue Jan 31, 2018 · 13 comments · Fixed by #4434

Comments

@zingmars
Copy link

Actual behaviour

When opening a file with a .m extension (Matlab source file), the app downloads it and prompts you to open with apps that don't even deal with text files - https://i.imgur.com/tXdv7PA.jpg.

Perhaps consider adding "Open As" button the same way the Total Commander app does (it lets you open files as if they were a text file/image/video/music no matter what the extension or mime type is, in case the app doesn't recognise it properly)?

Expected behaviour

Either it should open as a text file, or it should let you to open it with an app that supports text files

Steps to reproduce

  1. Have a .m file on NextCloud
  2. Try to open it with the Android app

Environment data

Android version: 8.0.0

Device model: OnePlus 3

Stock or customized system: Stock

Nextcloud app version: 2.0.0

Nextcloud server version: v13.0.0b4

@AndyScherzinger
Copy link
Member

@jancborchardt @MorrisJobke @tobiasKaminsky @mario What do you think? The Android app implements the Nextcloud servers mime type detection 1:1, so since the server doesn't know of .m neither does the Android client. So we could implement the mechanism described in the issue leaving the decision about the mime type to the user in case we can't/don't detect it but this would then of course add yet another menu entry to the file item menu.

@AndyScherzinger AndyScherzinger added the needs info Waiting for info from user(s). Issues with this label will auto-stale. label Jan 31, 2018
@jancborchardt
Copy link
Member

jancborchardt commented Jan 31, 2018

If we know that something doesn't work as expected, we shouldn't leave it up to every single user to manage it. :)

Meaning: We should add the .m mimetype to the server, and have it open as textfile (if no Matlab program is installed) as that seems the expected way.
No extra menu entry.

@zingmars
Copy link
Author

From how I see it, cataloguing every single major extension is going to be a fairly major task though, not to mention that the user might have files that he has himself created with arbitrary file extensions. You wouldn't be making the users to manage, you would be giving them the option to do so if they desire it.

@jancborchardt
Copy link
Member

We’re not building Nextcloud to give people settings/options, we’re building it to offer solutions.

And if adding certain extensions manually is necessary for that then so be it. You did have the feedback, and that’s how we properly solve it. :)

@AndyScherzinger
Copy link
Member

@jancborchardt would in your opinion this solution also apply for nextcloud/server#2073?

@jancborchardt
Copy link
Member

@AndyScherzinger I guess it does, no? As you say in that thread:

an we basically would need to have a mime type detection for .love file extension to map to application/x-love-game

So yeah, we do have to do what feels like strange handcoding for specific filetypes. But if that helps make the experience for those as expected, it’s the proper solution.

@AndyScherzinger AndyScherzinger added enhancement and removed needs info Waiting for info from user(s). Issues with this label will auto-stale. labels Jan 31, 2018
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.1.0 milestone Jan 31, 2018
@Spartachetto
Copy link

The problem with the various file formats happens also in the web interface.

It was reported both for the text editor: Manage the file extensions associated with texteditor (by me...) and and for the server[enhancement] NC needs a mime type handler selector (by an app developer).
If you read the text editor issues, several of them are about adding various file formats...

I wonder if a unified solution could be possible...

@Spartachetto
Copy link

@AndyScherzinger I have the impression that this is a duplicate of nextcloud/server#1756.

That issue made you open another issue in the server repository: Recognize further file extensions as text files (to be opened in the "in-app" text editor).

@AndyScherzinger
Copy link
Member

@Spartachetto to some extend yes but relying on the server's mimeType detection hasn't been implemented yet and also the servers mimeType detection would have to be extended to recognize Matlab files since that would be yet another extension.

@Spartachetto
Copy link

@AndyScherzinger Thank for your answer!

I got "interested" in mimeType detection because I wanted to open with the text editor files with a .R extension (R language files ).

Do you think that I have to open another issue here in the android app repository, or better to ask in the server repository?
I'm missing the details of what you decided in this issue... 🙂

@AndyScherzinger
Copy link
Member

Hi @Spartachetto,

no need for another issue :) I haven't decided anything since this is a group effort/project. @tobiasKaminsky @mario any opinion? I agree with @jancborchardt to simply extend the mimeType mapping (for now) and maybe do a more general solution later as described by Tobias.

@tobiasKaminsky
Copy link
Member

tobiasKaminsky commented Feb 16, 2018

If we want to have .r files open in our own text preview, then we of course have to implement it.
The other issue about .love (#2073) can maybe/hopefully solved in a different way.

@tobiasKaminsky tobiasKaminsky removed this from the Nextcloud App 3.1.0 milestone Mar 14, 2018
@AndyScherzinger
Copy link
Member

@tobiasKaminsky any ideas? I tried to implement a mapping but with the actual implementation the mimetype of the OCFile is used which is application/octet-stream and thus it is treated as "file" and not as text since it doesn't check for file extension mappings. Meanwhile the webUI on Nc13 detects this file as text and opens the text editor. So I am not sure why this works for web but not for the Android client.

AndyScherzinger added a commit that referenced this issue Aug 28, 2019
…for .m files

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AndyScherzinger added a commit that referenced this issue Aug 28, 2019
…for .m files

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AndyScherzinger added a commit that referenced this issue Sep 2, 2019
…for .m files

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AndyScherzinger added a commit that referenced this issue Sep 2, 2019
…for .m files

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AndyScherzinger added a commit that referenced this issue Sep 2, 2019
…for .m files

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.8.0 milestone Sep 3, 2019
backportbot-nextcloud bot pushed a commit that referenced this issue Sep 4, 2019
…for .m files

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants