Skip to content

File paths break on selecting an already uploaded file (Windows) #2412

@jvanoostrom

Description

@jvanoostrom

When selecting an already uploaded file through the admin panel (eg. a header image) the path slashes reverse (from / to \), resulting in a 404 when rendering the image. This occurs on XAMPP for Windows.

Details

Question Answer
Relevant Bolt Version master
Install type Composer install
BC Break N/A
PHP version 7.4
Web server Built-in, symfony
For UX/UI issues N/A

Reproduction

On Windows, first upload a file. All looks well (/ slashes everywhere, image gets rendered). Now create a new page or edit the existing page and select an existing file. The slashes reverse to \ and the image does not get rendered (404).

Bug summary

When selecting an already uploaded file through the admin panel (eg. a header image) the path slashes reverse (from / to \), resulting in a 404 when rendering the image. This occurs on XAMPP for Windows.

Specifics

Example file name:
/files/entries/1920-737-8.jpg

changes to

/files/entries/920-737-8.jpg

Steps to reproduce

On Windows, first upload a file. All looks well (/ slashes everywhere, image gets rendered). Now create a new page or edit the existing page and select an existing file. The slashes reverse to \ and the image does not get rendered (404).

Expected result

The selected image gets rendered properly

Actual result

Due to the slashes reversing, the image rendering results in a 404 error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions