Skip to content

Folders can be added as version files through drag-and-drop #1742

@MMK21Hub

Description

@MMK21Hub

Describe the bug

When editing a version, dropping a folder into the Files section adds the folder as a 0-byte file. This causes the version creation to fail.

This issue can also be experienced when directly dropping a folder into the Versions tab of a project.

After further research, this issue can also be reproduced by overriding the suggested file types in the file picker when uploading a version file. Therefore, the core of this issue seems to be that the frontend relies on the filetype hint being respected to avoid undefined behaviour.

A screenshot of a version's "Files" list, showing files with zero bytes

Steps to reproduce

  1. Go to the Versions tab of a project that you own
  2. Drag a folder from your file manager into Modrinth

Expected behavior

An error would be shown explaining that only files, not folders, can be uploaded. Alternatively, the drag-and-drop operation would be ignored.

Additional context

Since resource packs and datapacks function as folders, users may try to drag folders into Modrinth to add them to a version. Perhaps there should be a message explaining that such packs need to be distributed as a zip.

System information:

  • Zorin OS 16.2 x86_64
  • GNOME Shell 3.38.4 (X11)

Everything is a file in Unix

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is neededwebRelates to Modrinth.com web frontend

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions