404 error when link clicked

Created on 26 June 2023, about 1 year ago
Updated 12 July 2023, 12 months ago

Problem/Motivation

I installed module and made sure files are set to private.
I enabled the counter and then went to the media file field and set it to "File with Download Statistics recorded".
When I view the node and click the file, it generates a 404 page not found error.
If I switch to other formats, they all work, so it is only this module's option that generates the error.

Is there something I am missing?
I tried to see the ReadMe file on the module but it is empty with zero documentation or instructions.

Any help or clarification is much appreciated.

Thank you.

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇺🇸United States jsidigital

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

Comments & Activities

  • Issue created by @jsidigital
  • 🇮🇳India shailja179 India

    @jsidigital, It is working for me. You can check if your private folder name/permission is correct.

  • 🇺🇸United States jsidigital

    Hello Shailja179,
    What do you mean that the private folder name/permission is correct?

    Are you referring to the actual ftp private folder? This is correct because if I switch to regular generic file download, the file downloads. Only when I select file with counter that I get a 404 page error.

    Not really sire what you mean. Hope you can explain in more detail?

    Thank you.

  • 🇮🇳India shailja179 India

    @jsidigital, yes i am talking about file structure permission of private folder. But its working for me fine.
    May be some custom module is causing the issue on your side.

  • Status changed to Needs review 12 months ago
  • 🇺🇸United States oivanov

    @jsidigital, let me recap :

    To get everything working, you need to have the following -

    First: in your settings.php you need to have the private file path set like so -

    $settings['file_private_path'] = 'sites/default/files/private';

    look around Ln. 525 in settings.php. Set the path to a folder of your choosing.

    Second: On the Download Statistics module's Config page, you need to have the Count File Downloads check box enabled/checked

    Third: on one of the content types, you need to have a field of type File - not Media, just a regular File. In the Field Settings of the field, you need to have Upload Destination set to Private files.
    In the Manage Display for that same field, you need to choose File with Download Statistics Recorded.

    When all that is set, everything is working for me as expected.

    Let me know if you're still having problems.

    Thanks!
    Oleg

  • Status changed to Closed: works as designed 12 months ago
  • 🇺🇸United States oivanov

    closing this as it looks like the module is working as designed, the error most likely was due to mis-configuration

    will re-open if needed

Production build 0.69.0 2024