zhanghai / zhanghai/MaterialFiles

Cannot open zip file which contains a directory with the same name

Open
#1,448 0 comments 0 reactions 1 assignee View on GitHub

@zhanghai is already working on this.

Since Jul 6, 2025.

bug
Dominant language
Kotlin
Stars
9k
Forks
736
PR merge metrics
No merged PRs in 30d

Description

It appears that if a zip file's top-level content is a directory with the same name as the zip file itself without the .zip (such as zip files created by Material Files itself!), Material Files gets confused, and thinks it's a file rather than a directory, and fails to open or extract it. If I try to open it, the zip file itself "opens", but tapping the directory (which is displayed like a file), it throws an error. See attached file and screenshot. If I rename the zip file, without changing its contents, it works.

test.zip
Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.