---
title: "ke_stats mit naw_securedl. Download Counter nicht funktioniert"
url: "https://www.typo3.net/d/113410-ke-stats-mit-naw-securedl-download-counter-nicht-funktioniert"
source: "typo3.net"
tags: ["Extensions","Frage"]
created: "2013-01-12"
last_reply: "2013-01-14"
replies: 1
solved: false
page: 1
pages: 1
lang: "de"
---

# ke_stats mit naw_securedl. Download Counter nicht funktioniert

Extensions · 1 Antwort · gestartet 2013-01-12

## Eröffnungsbeitrag

**student-uni** · 2013-01-12 · [Beitrag #1](https://www.typo3.net/d/113410-ke-stats-mit-naw-securedl-download-counter-nicht-funktioniert/1)

Hallo Zusammen,

bei mir zählt ke_stats Downloads von secured file links nicht.

Beim direkten download Link funktioniert Zähler wohl: mysite.de/uploads/myfile.pdf (der Zähler wird auf +1 hochgezählt.)

Beim secured download Link funktioniert Zähler nicht: mysite.de/index.php?eID=tx_nawsecuredl&u=345&file=uploads/myfile.pdf&t=1358114440&hash=4170121359c8f4256b1fb23c7d1b06665a3cff18

Wie kann man Download counter am laufen bekommen ?

Vielen Dank

P.S.

in htaccess habe ich rewrite von ke_stats:

RewriteRule ^(.*)\.(doc|odt|pdf)$ index.php?eID=tx_kestats_filecounter [L]

und Verbot auf direkten Dateizugriff
<FilesMatch ".(xlsx|gz|pdf|zip|rar|txt|odt|ppt|pptx|docx|doc)$" >
order allow,deny
deny from all
Allow from localhost
</FilesMatch>

## Antworten

### [#2](https://www.typo3.net/d/113410-ke-stats-mit-naw-securedl-download-counter-nicht-funktioniert/2) · nebukadnezar · 2013-01-14

Das geht tatsächlich nicht so einfach out-of-the-box, da ja naw_securedl auch die Ausgabe der Dateien umlenkt, genau wie ke_stats.

Der sauberste Weg wäre, über einen Hook in naw_securedl die Zählung in ke_stats anzustoßen.

Ein anderer Weg ist, die Extension naw_securedl zu patchen, das wäre so zu lösen:

In "class.tx_nawsecuredl_output.php", Funktion "logDownload" folgendes eintragen (wobei unter "pid" die ID des Sys-Folders einzutragen ist, auf der die Daten im Backend abrufbar sein sollen):

if (t3lib_extMgm::isLoaded('ke_stats')) {
                        $keStatsObj = t3lib_div::getUserObj('EXT:ke_stats/pi1/class.tx_kestats_pi1.php:tx_kestats_pi1');
                        $keStatsObj->initApi();
                        $keStatsObj->statData['year'] = date('Y');
                        $keStatsObj->statData['month'] = date('n');
                        $keStatsObj->increaseCounter(
                                'Downloads', // category
                                'element_title,year,month', // comparefieldlist
                                basename($this->file), // title
                                0, // uid
                                123, // pid
                                0, // lang
                                0, // type
                                'extension' // stat type
                        );
                        unset($keStatsObj);
        }

---

Quelle: „ke_stats mit naw_securedl. Download Counter nicht funktioniert“, typo3.net, https://www.typo3.net/d/113410-ke-stats-mit-naw-securedl-download-counter-nicht-funktioniert
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
