presents
SendFileAndLog PHP-Class
Download the latest release:
Version 1.10 from 31st, January 2007
Download statistics
Total 284 downloads
from 2007-02-01 15:52:20 to 2022-08-14 22:34:11
The time period complies to:
5673.28 Days or 810.47 Weeks or 186.00 Months or 15.00 Years
Average Downloads per:
Day: 0.05 * Week: 0.35 * Month: 1.53 * Year: 18.93
Sample of the statistic feature (LIVE!)
Introduction:
SendFileAndLog is a simple PHP class that lets you replace your
normal web page download links with a special link that lets you
keep a detailed log entry and or keep track of statistics for every download,
while not changing the user experience in any way.
You can use the class in two ways:
- In your own PHP script. The class is fully configurable
and you can use all the features the way you want.
- Without writing any PHP yourself. Use the included php
helperscript, a text configuration file, and perform a simple
modification to the normal HTML links in your original webpage.
Back to top
Features:
-
Writes a full detailed log in a textfile for every download
with the following informations:
- Timestamp, date and time (in formatted textual form) of download
- Path/Filename of the sourcefile that is sent
- Filename of the recommended savefilename at the users browsers save dialog
- Remote IP-Address, accepted language and user agent (Browser type)
- Referrer (which page/location sent the download request)
- Full Path/Scriptfilename that initiated the download
-
Logfile is in CSV-format
No database is needed and it can be loaded in
any application that understands CSV (e.g. MS-Excel)
for futher analysis.
-
Get a statistic for the logged downloads online
Get it as a PHP-Array variable for use in your own PHP script,
or as a nicely formatted CSS html div element for displaying
live on your html page (see the example on the http://www.jotosoft.de/sendfileandlog
website). It can include the following information:
- Timestamp, date and time (in formatted textual form) that indicates when logging began (Timestamp is hidden in HTML-Output)
- Timestamp, date and time (in formatted textual form) that indicates when logging ends - always actual time (Timestamp is hidden in HTML-Output)
- Number of seconds, days, weeks, months and years that represent the logged time period (Seconds are hidden in HTML-Output)
- Total number of downloads
- Average number of downloads per day, week, month and year
-
Can be switched into "Statistics only" mode, not writing the
detailed log if you are not interested in who, when downloads your file.
-
Fully configurable with logfilename, statisticfilename,
dateformat, timeformat, etc.
-
Smart default values are used for all possible configurations
if you don't want to set them yourself.
-
Using the configfile and remotefilename
recommendation feature can be used to obfuscate the real download location and filename
to prevent "direct linking" to the file from external sites.
-
Secure! All config-, log- and statisticfiles
are in a subfolder that is protected via a .htaccess file from direct
linking and showing the content in the users browser. All incoming parameters while
using the "sfalhelper" script (included with the class) are rewritten to point to this protected subdirectory
preventing harmful url injections.
-
OH...and did i already mention that
it is free and you can use it without any costs and limitations? No? Okay,
then I have it done now! :-)
Back to top
Disclaimer/License:
This class is Freeware/Donationware!
You can use this code for free and without restrictions as long as you leave the copyright annotation unchanged!
If you change or improve the class, please send your changes back to author, so that he can implement the
changes in the next release.
This class is released AS IS. The author cannot be held responsible in any way for any damage that occurs to your
hardware, software and your data from using this class. Use it at your own risk!
Back to top
Donate:
I am a proud member of
DonationCoder.com
community. If you find this class useful and want new versions and bugs fixed, please consider making a donation to me
in any amount you feel comfortable with.
Please click the DonationCoder logo to the right or
HERE to make a donation.
Thank you very much in advance!
Back to top
History:
- 16.01.2007 V 1.00
- 31.01.2007 V 1.10
- Added: Statistic functioninality
- Added: Different LogModes (FullLog and StatOnly)
- Added: .htaccess support for protecting the log-, statistic- and configfiles from direct linking
- Changed: SetDateAndTime Functionality
- Changed: Constructor
- Notice: Logfilecontent and or code is incompatible with older versions of this class
Back to top
Contact:
Contact me for questions, bugreporting and suggestions by eMail at:
Your mail will be appreciated.
Back to top