Redirect to private files not working

Created on 4 May 2022, about 2 years ago
Updated 21 February 2024, 4 months ago

Problem/Motivation

If media file is located in the private file system, the URL for redirection is invalid. (It contains '.../default/files/private://documents/...')

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

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.

  • πŸ‡³πŸ‡±Netherlands Rhezios
  • Status changed to Needs review about 1 year ago
  • πŸ‡³πŸ‡±Netherlands timohuisman Leiden, Netherlands
  • First commit to issue fork.
  • @afinnarn opened merge request.
  • πŸ‡ΊπŸ‡ΈUnited States afinnarn

    Hello. I looked at the patch and it has "'system/files" hardcoded as the base path for private files. I made a MR that should cover the private scheme as well as the public scheme.

    Please take a look, see if it works for you, and let me know what you think.

  • πŸ‡ΊπŸ‡ΈUnited States cameron prince

    cameron prince β†’ made their first commit to this issue’s fork.

  • Status changed to Fixed 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States cameron prince

    Changes look good and have been merged. Closing this as fixed!

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Status changed to Fixed 4 months ago
  • πŸ‡³πŸ‡±Netherlands Rhezios

    Hi,

    Hello. I looked at the patch and it has "'system/files" hardcoded as the base path for private files. I made a MR that should cover the private scheme as well as the public scheme.

    The reason for the hardcoded string is the route for private files. Private files are served by the route "system.private_file_download" and not the path of the file itself. PrivateStream::basePath() returns "Settings::get('file_private_path')" which is not accessible over the web server.

    * A local file system path where private files will be stored. This directory
    * must be absolute, outside of the Drupal installation directory and not
    * accessible over the web.

Production build 0.69.0 2024