[Zope] Download counter
Paul Zwarts
paz@oratrix.com
Mon, 5 Nov 2001 12:43:29 +0100
Hi,
You could do it that way, but wouldn=92t that mean that when you load =
the
page, the link itself will increase the counter whether or not you
followed that link, making it ineffective. On our website, I use a
query_string that runs a method that increases and THEN fetches the URL,
rather than being direct. That way you can also mask the the actual
address is necessary. You can check it out in the Links section of our
site:
www.oratrix.com
It may give you an idea or two....
Best regards,
Paul Zwarts
-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org] On Behalf Of
e-Musty
Sent: Monday, November 05, 2001 11:23 AM
To: zope@zope.org
Subject: [Zope] Download counter
Could anyone tell me how to implement a very single download counter?
=A0
I mean the followings:
Assume you have a folder named media with subfolders such as audio,
video, pic. All subfolderes might have another subfolders, e.g. mp3,
wav, ra for audio etc. All folder might have files, not just the lowest
one.
=A0
The tricky thing I cannot figure out is how to write a script=A0able to
maintain download counts.=20
=A0
What I've tried is that I've made=A0the following change to =
my=A0ZCatalog's
search result page:
=A0
<dtml-in aCatalogue>
=A0 <a href=3D"fileDownload('<dtml-var =
sequence-item>')">title_or_id</a><br>
</dtml-in>
where fileDownload would be a Python script doing the stuff by checking
the file's properties. If the file in question has a dwc attribute, it
increases its value by one, if does not have, it creates the dwc
property and sets its value to 1.
The problem is that I cannot reach the object passed to the script. The
question is, how to access that passed File object from Python. Can
anyone help me?
=A0