Somehow, a file I uploaded had "_0" appended to its file path, but not the name. Since the file_download hook sends the file path, not the name, the module fails to count the downloads.

Comments

Chill35’s picture

Somehow, a file I uploaded had "_0" appended to its file path.

That's because a file already exists with that name in your folder.

If you want to update that file, you can overwrite it using FTP.

Alternatively, you can DELETE (safely) the attachement, and save your node. Then reopen your node and attach the new (updated) file.

The download_count will not be reset for that file name, it will resume counting downloads for that updated file, picking up where it left off.

Chill35’s picture

You say that I count downloads using the filename rather than the path. And that in some cases filename is NOT path.

There's a bug there.

I will look into this, thank you.

Chill35’s picture

I just changed a few things in the module to hopefully fix the bug.

Please install 6.x-1.3 and let me know. Your feedback would be _greatly_ appreciated.

Thank you! :-)

Chill35’s picture

Assigned: Unassigned » Chill35
Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.