Sunday, January 3, 2010

Re: Media View / Download: How to count finished downloads?

you can ONLY check if somebody starts to download
not if he stops it or finishes it

for counting just add the model method call before
you pass those vars to the media view

$this->Model->touch();
$this->set($params);

with touch() being your count method!

(in your controller action)


On 3 Jan., 18:10, DigitalDude <e.blumsten...@googlemail.com> wrote:
> Hey,
>
> in my app I have some type of file uploading, and also downloading.
> I'm using Cake's Media View, so I can send the file to the user after
> authenticating that he/she is allowed to get that file.
>
> So I was wondering, is there any chance to COUNT these downloads? All
> I have in my action is a view-like action which sets the params. I
> could then just save a counting value to my databse, but I think
> that's not really the way to go...
>
> (basic usage of the media view...)
>
>         $this->view = 'media';
>         $params = array(
>               'id' => $file['Upload']['hash'],
>               'name' => $file['Upload']['name'],
>               'download' => true,
>               'extension' => $file['Upload']['type'],
>               'path' => APP . '/uploads/'.$modelpath.'/'
>        );
>        $this->set($params);
>
> Is there any kind of callback or so after a user has successfully
> downloaded a file?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate