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

Not able to open a ZIM file from Samsung's "My Files" file explorer #4002

Closed
kelson42 opened this issue Sep 21, 2024 · 8 comments · Fixed by #4022
Closed

Not able to open a ZIM file from Samsung's "My Files" file explorer #4002

kelson42 opened this issue Sep 21, 2024 · 8 comments · Fixed by #4022
Assignees
Labels
Milestone

Comments

@kelson42
Copy link
Collaborator

On on my Android14 Samsung tablet
Screenshot_20240921_121158_My Files

@kelson42 kelson42 added the bug label Sep 21, 2024
@kelson42 kelson42 added this to the 3.12.0 milestone Sep 21, 2024
@jangalasriramd7
Copy link

Hey Kelson, Can I work on this issue...

@kelson42
Copy link
Collaborator Author

@jangalasriramd7 Thank you for your offer, but I have already assigned the issue to @MohitMaliFtechiz and would prefer to keep it like that. Maybe you can pick up one of the goodfirstissues?

@MohitMaliFtechiz
Copy link
Collaborator

MohitMaliFtechiz commented Sep 25, 2024

@kelson42 The problem is with the Samsung file manager application. The Samsung file manager passes the empty mimeType when we click on the zim file in the file manager of Samsung. That's why our application does not recognize that intent. Also, we have implemented the approach where we have added the pathPattern for zim files, but that also does not work in the case of Samsung file manager since it is giving the intent data in this form File path: /external/file/2826 which does not have the .zim in it.

I have installed a fileManager in this Samsung mobile and tried to click on the zim file there and it works.

A proper explanation is given here https://forum.developer.samsung.com/t/opening-files-with-unknown-content-type-from-my-files/30335 about this problem.

XRecorder_25092024_151907.1.mp4

@kelson42
Copy link
Collaborator Author

@MohitMaliFtechiz Opening ZIM file has to work with most common file manager. Samsung is probably the biggest Android reseller, it has to work on there device. Can you please update the CI accordingly?

@MohitMaliFtechiz
Copy link
Collaborator

@MohitMaliFtechiz Opening ZIM file has to work with most common file manager. Samsung is probably the biggest Android reseller, it has to work on there device. Can you please update the CI accordingly?

@kelson42 you are right it should work, but it can not work due to Samsung's "My Files" implementation. They do not recognize the application/octet-stream as standard mimeType of Android and return the empty mimeType for our ZIM files, and due to the empty mimeType, our application does not recognize it. Keyman(keymanapp/keyman#10133) is also facing the same issue for their files with Samsung "My Files" since their files mimeType is the same(application/octet-stream). Samsung acknowledged the issue in their app, but they refused to fix it.

A temporary fix I was trying to create a custom intent filter for Samsung "My Files" It works but it shows our application in the suggestion list for all the files(e.g. image video, pdf, etc) which is not good.

@kelson42
Copy link
Collaborator Author

Which software that says the ZIM file mimetype is application/octet-stream or does that come from the OS? We should have a custom/dedicated mimetype?

@MohitMaliFtechiz MohitMaliFtechiz changed the title Not able to open a ZIM file from file explorer Not able to open a ZIM file from Samsung's "My Files" file explorer Oct 29, 2024
@MohitMaliFtechiz
Copy link
Collaborator

@kelson42 The mimeType is coming from the OS, and if I view the details of the ZIM file on my PC then it also shows the same mimeType for the ZIM file. Regarding the custom mimeType: Samsung's file explorer returns the mimeTypes for standard files, e.g. images, videos, pdf, etc. I have to do some research first that it returns the mimeType or not for the dedicated mimeType, otherwise, we have to enable all mimeTypes for the "my files" file explorer like I done in #4022.

Image

@kelson42
Copy link
Collaborator Author

kelson42 commented Oct 29, 2024

@MohitMaliFtechiz If it's not possible to get proper ZIM mimetype, then we have to allow Kiwix to open any file.... Which implies a proper error mgmt, in case the file is not a ZIM file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants