עריכה 2
בעע.. זה קוד מקור ואין לי מהדר, אני לא רוצה להתעסק עם זה, מישהו יכול להביא גרסה מקומפלת? (זה בשביל השרת המקומי שלי ואני מריץ Windows XP אז קובץ DLL...)
typedef struct _uploadprogress_data {
char * identifier; /* full filename, or just the identifier, depending on method */
char * identifier_tmp; /* full filename, or just the identifier, depending on method */
time_t time_start;
time_t time_last;
unsigned int speed_average;
unsigned int speed_last;
unsigned long bytes_uploaded;
unsigned long bytes_total;
unsigned int files_uploaded;
int est_sec;
} uploadprogress_data;
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2003 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_02.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Christian Stocker (chregu@bitflux.ch) |
| Derived from: Doru Petrescu (pdoru-php-upm@kappa.ro) Â Â |
| http://pdoru.from.ro/upload-progress-meter/ |
+----------------------------------------------------------------------+
/* {{{ uploadprogress_module_entry
*/
zend_module_entry uploadprogress_module_entry = {
STANDARD_MODULE_HEADER,
"uploadprogress",
uploadprogress_functions,
PHP_MINIT(uploadprogress), /* Replace with NULL if there is nothing to do at php startup */
PHP_MSHUTDOWN(uploadprogress), /* Replace with NULL if there is nothing to do at php shutdown */
PHP_RINIT(uploadprogress), /* Replace with NULL if there is nothing to do at request start */
PHP_RSHUTDOWN(uploadprogress), /* Replace with NULL if there is nothing to do at request end */
PHP_MINFO(uploadprogress),
"0.0.1",
STANDARD_MODULE_PROPERTIES
};
/* }}} */
if (strcmp(template, "") == 0) {
return;
} else {
filename = uploadprogress_mk_filename( id, template );
if (!filename) return;
F = VCWD_FOPEN(filename, "rb");
if (F) {
array_init(return_value);
while ( fgets(s, 1000, F) ) {
char *k, *v, *e;
e = strchr(s,'=');
if (!e) continue;
*e = 0; /* break the line into 2 parts */
v = e+1;
k = s;
/* trim spaces in front and after the name/value */
while (*k && *k <= 32) v++;
while (*v && *v <= 32) v++;
for (e=k; *e; e++) if (*e <= 32) { *e = 0; break; }
for (e=v; *e; e++) if (*e <= 32) { *e = 0; break; }