system.private_file_download always wins over system.files route

Created on 25 March 2016, over 9 years ago
Updated 22 July 2025, 12 days ago

Problem/Motivation

You should be able to download a file via any stream wrapper using the system.files route. Fx an url like

http://example.com/system/files/public?file=example.png

You would expect that Drupal would try to find

public://example.png for download.

What happens instead is that Drupal tries to find

private://example.png (it always uses the private stream wrapper.

Proposed resolution

This should be fixed so the system.files route actually can be used.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component

file system

Created by

🇩🇰Denmark googletorp

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India mohit_aghera Rajkot

    I came across this issue while doing the bugsmash triage.

    I notice that issue is still valid.
    The route for private file download system.files already takes the stream wrapper argument.
    However, it is overriding value to `private`.
    So there is no meaning of passing wrapper in the URL although route has the URL.

    I believe this would need more discussion about refactoring and proper implementation.

Production build 0.71.5 2024