Skip to content

Uploaded file URL inherits the case of the names of folders the file is in under Assets in admin dashboard #78

@polynook

Description

@polynook

Problem

When accessing uploaded assets, their URL reflects their hierarchical placement inside folders and also inherits folder names along with their case. Examples:

Assets/my_image.png
translates to
localhost:4000/api/uploads/my_image.png

If I copy my_image.png to Assets/Images folder, it translates to
localhost:4000/api/uploads/Images/my_image.png with Images directory being uppercase.

If I copy my_image.png to Assets/images folder, it translates to
localhost:4000/api/uploads/images/my_image.png with images directory being lowercase.

Reasoning

Most websites handle slugs by having them lowercase and while it is not a requirement to have them in this format, one might want to have them lowercase.

The solution would be to rename the Images folder to images.

However, this creates another problem. In general, when working with GUIs, a lot of people like to uppercase file and folder names. This pattern can be observed all over Windows OS itself. With the above solution applied, the folder name would be lowercase which would conflict with the presented file and folder naming workflow.

Since Burdy takes inspiration from Microsoft and Wordpress, it is worth considering this issue. In addition, I believe Wordpress "snake-cases" file names on upload but leaves their label for displaying in UI purposes intact.

Proposal

When creating a new folder, show a similar dialog to the one when adding fields where one can input a Label and a Name:

  • Label — folder name shown in admin dashboard.

  • Name — used when generating a slug.

2022-01-08-182017

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions