[Zope] Download counter - only successful downloads

Paul Zwarts paz@oratrix.com
Tue, 6 Nov 2001 10:41:19 +0100


Danny,

I cant say for sure because were quite happy counting downloads after
the link was selected and then delivering the file, but I highly doubt
that a file could be counted AFTER it was totally downloaded... Only
probably way could be to have a link saying 'click here when finished'
but people would never do that.

You _COULD_ write a filesystem protocol that monitors the TCP/IP layer
and watches for a stream, and then interates a counter when the state
closes after, but that would be a lot of work for little gain.

Cheers,
Paul Zwarts

-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org] On Behalf Of
Danny William Adair
Sent: Monday, November 05, 2001 9:49 PM
To: Paul Zwarts; emusty@mailbox.hu; zope@zope.org
Subject: Re: [Zope] Download counter - only successful downloads

I would also like to implement a download counter.
Is there any realistic way of having it count only files that have been=20
_successfully_ and _fully_ downloaded? I know there is a "precondition"
for=20
file objects (that can do whatever, e.g. increase a counter), but is
there=20
something like a postcondition?

I am not sure if this is actually possible, but my feeling is yes.

Thanks for your help,
Danny

On Tuesday 06 November 2001 00:43, Paul Zwarts wrote:
> 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.
> =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
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -=20
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )