Closed (fixed)
Project:
Download Count
Version:
6.x-1.3
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
13 Feb 2007 at 11:52 UTC
Updated:
17 Jun 2008 at 18:12 UTC
Hi All,
Have a bit of an issue where no downloads are showing up in the download counter. I installed the module as per usual and have verified that the file_downloads table is created, however no data is being inserted into the table. At first I thought this may have been due to the fact I only had pre-existing file attachments (nothing new since installing download_count) so I created a new node and attached a small file. However the same happens and no download data is recorded in the DB or displayed in the download_center page. Has anyone got any ideas why this might be as I feel like I am missing something really obvious in my setup?
Comments
Comment #1
Chill35 commentedThe download counter should work with previously attached files. It starts to count downloads on whatever file is attached after the module is installed, whether the file is attached before the module is installed or after.
One way to debug the problem is to look at your logs. When you (or anyone else) downloads a file attached to a node, is there a logging message that says that this file has been downloaded ?
Is the file attached to a CCK or Flexinode node ?
Thanks for trying out the module by the way, it's brand-spanking new.
Comment #2
Chill35 commentedMy wording was confusing. Let me rephrase it :
The module starts to count downloads as soon as the module is installed on whatever file is attached, whether the file is attached before the module is installed or afterwards.
Comment #3
Chill35 commentedJust a sanity check here : the module counts downloads, not uploads. After uploading a file to a node, you have to download it once to test if the module works. Just in case there was a misunderstanding here about what the module does.
Comment #4
brashquido commentedYep, definitely checking downloads :). I just had a look at my logs and there is no download entries there. In fact there is no download message type which as I read the module description should be there. I'm using Drupal 4.7.6 on a Windows 2003 Server with IIS6 and PHP 4.4.1 if it makes any difference?
Comment #5
Chill35 commentedLOL Ok ;)
Is the node a special kind of node ? (CCK, Flexinode)
Comment #6
Chill35 commentedFYI, the module will work with files that have been uploaded using the (core) upload module. In other words, files that are e-commerce products or 'quickfiles'... I don't know if the module will work for these.
Here's something to check : the file that you downloaded, is it in the {files} table in your database ? That's the table used by the core upload module.
Comment #7
Chill35 commentedIf you know php, you can debug the module this way.
Here's how the module works : it uses a module hook function : whenever a file that was uploaded /w upload.module is downloaded, the hook function download_count gets called in all modules if it ever is defined in them. So you can add this line at the beggining of the function download_count_file_download in download_count.module :
Then download a file and see if there's a box that shows up when you refresh the page that says : "The download_count module has been called."
Comment #8
Chill35 commentedOupsy, it ain't the hook function download_count that gets called in all modules, it's {module_name}_file_download() that gets called. Sorry for that typo.
Comment #9
Chill35 commentedThere is something wrong with how the database is created. I will fix that for tomorrow. Thanks for reporting your failure to use the module :)
Comment #10
brashquido commentedWow, you have been busy in the last half hour :). Glad I was able to help in someway, and I look forward to the fix :)
Comment #11
Chill35 commentedAs it turns out, brashquido, it looks like the hook function is called only when files have been downloaded using 'private download'. There's nothing wrong with the created database.
Are you using public download ? (i.e. Public - files are available using http directly.)
Please look in your admin/settings in section File system settings.
Let me know. If that really is the problem, I will make it clear on the project page that the module only works for private downloads.
Thanks for checking this out for me.
Comment #12
Chill35 commentedJust to clarify, when downloading a file that was "publically" uploaded, the file is available for download using HTTP. The file is downloaded without going through Drupal AT ALL. Because Drupal is totally unaware that the file is being downloaded, then nothing can be recorded about the said download.
Our posts crossed. Please confirm if you're using 'public upload' by checking in your admin/settings in section File system settings. Thanks in advance ;)
Comment #13
Chill35 commentedScrap that : Just to clarify, when downloading a file
that was "publically" uploadedwith download method set to public, the file is available for download using HTTP.Comment #14
brashquido commentedSpot on, that was it! Can't remember why I had files set to public, I vaguely remember there being some issue. Not to worry though, switching from public to private and now the downloads are being tracked in the download center. Thanks for your help, that would never have occurred to me :) .
Comment #15
Chill35 commentedNo need to thank me : I have to thank you. I was always using private and did not even consider the public vs private issue.
I added an admin setting page to troubleshoot the possible overlook. The admin page checks whether the download method is set to private or public and says so.
I also updated the project page with this information. :)
Comment #16
brashquido commentedExcellent! Just figured out why I had the download method set to public. Until now I was tracking downloads using AWStats via my server log files, and with the download method set to private it doesn't seem to pick it up. The URI Stem changes from;
/files/filename.yar.gz
with public, to;
/index.php q=system/files/filename.tar.gz
with private. Doesn't matter now though with this module :)
Comment #17
alex288288 commentedsooo...where is this download center everyone is talking about..i have looked around..if you could send me in the right area that would great
Comment #18
Chill35 commentedIt's in the Navigation menu. You can also type in http://myWebSite.com/download_counter to access the page.
You have admin settings for that module.
Comment #19
Chill35 commentedComment #20
Tedhere commentedHelp, If I have the download method set to Private then it will count the downloads BUT anonymous users get a "access denied" page when they try to download it.
Please show me what I'm overlooking. Thanks
Comment #21
Chill35 commentedYou need to grant to the role 'anonymous user' the permission to 'view uploaded files' on your admin/user/permissions page.