uploadprogress Example
Welcome to the uploadprogress
extension example!
Click on the file field below or the "Browse" button to select
a file, and then click the "Upload" button. For best results,
select a large file — something over 10 MB. As the file uploads,
you will see the progress bar fill up. You should also see a
guess about the file's type. This uses the
fileinfo extension to
examine the bytes as they're being uploaded to guess the file
type.
To learn more about what's going on in this example,
read
the code.
It looks like you're uploading .
uploadprogress-2.0.2/examples/nginx.conf 0000644 0000765 0000024 00000001224 14125450113 017552 0 ustar ramsey staff server {
listen 80;
root /var/www/html;
index index.html index.php;
client_max_body_size 13G;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_pass php-fpm:9000;
fastcgi_index index.php;
}
} uploadprogress-2.0.2/tests/mocks/get_contents/upload_contents_basic-formFieldId 0000644 0000765 0000024 00000001242 14125450113 027363 0 ustar ramsey staff Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse placerat
risus ac augue lacinia, sed aliquam sapien ullamcorper. Nulla ipsum diam,
condimentum nec vulputate sodales, convallis vel neque. Morbi at rutrum arcu,
sit amet ullamcorper velit. In erat risus, blandit sit amet imperdiet eget,
auctor a turpis. Nulla vel augue elit. Pellentesque vestibulum dui nisl, a
auctor leo accumsan in. Etiam eget varius metus. Donec eu pulvinar metus, ac
vulputate erat. Integer viverra augue quis mauris vestibulum, vel rutrum ante
dapibus. Donec venenatis viverra mollis. Pellentesque id magna sit amet leo
lobortis faucibus. Nam eu tellus vel nibh lobortis tincidunt.
uploadprogress-2.0.2/tests/mocks/get_contents/upload_contents_variation003-formFieldId 0000644 0000765 0000024 00000001242 14125450113 030521 0 ustar ramsey staff Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse placerat
risus ac augue lacinia, sed aliquam sapien ullamcorper. Nulla ipsum diam,
condimentum nec vulputate sodales, convallis vel neque. Morbi at rutrum arcu,
sit amet ullamcorper velit. In erat risus, blandit sit amet imperdiet eget,
auctor a turpis. Nulla vel augue elit. Pellentesque vestibulum dui nisl, a
auctor leo accumsan in. Etiam eget varius metus. Donec eu pulvinar metus, ac
vulputate erat. Integer viverra augue quis mauris vestibulum, vel rutrum ante
dapibus. Donec venenatis viverra mollis. Pellentesque id magna sit amet leo
lobortis faucibus. Nam eu tellus vel nibh lobortis tincidunt.
uploadprogress-2.0.2/tests/mocks/get_contents/upload_contents_variation004-aFieldId 0000644 0000765 0000024 00000000000 14125450113 027766 0 ustar ramsey staff uploadprogress-2.0.2/tests/mocks/get_contents/upload_contents_variation006-field 0000644 0000765 0000024 00000000071 14125450113 027422 0 ustar ramsey staff Lorem ipsum dolor sit amet, consectetur adipiscing elit.
uploadprogress-2.0.2/tests/mocks/get_contents/variation005-fieldName 0000644 0000765 0000024 00000000071 14125450113 024741 0 ustar ramsey staff Lorem ipsum dolor sit amet, consectetur adipiscing elit.
uploadprogress-2.0.2/tests/mocks/get_info/upt_basic.txt 0000644 0000765 0000024 00000000307 14125450113 022525 0 ustar ramsey staff upload_id=file001
fieldname=uploadFile
filename=example.txt
time_start=1579893044
time_last=30
speed_average=300
speed_last=300
bytes_uploaded=1592342
bytes_total=3000000
files_uploaded=1
est_sec=45
uploadprogress-2.0.2/tests/mocks/get_info/upt_bug58318.txt 0000644 0000765 0000024 00000000426 14125450113 022634 0 ustar ramsey staff upload_id=974489
fieldname=fichier_video
filename=C:\Documents and Settings\franck\Bureau\taf\tevasia\1and1\video\Kumar.flv
time_start=1219105999
time_last=1219106351
speed_average=49492
speed_last=51190
bytes_uploaded=17421484
bytes_total=28610177
files_uploaded=0
est_sec=226
uploadprogress-2.0.2/tests/mocks/get_info/upt_variation003.txt 0000644 0000765 0000024 00000000307 14125450113 023663 0 ustar ramsey staff upload_id=file004
fieldname=uploadFile
filename=example.txt
time_start=1579893044
time_last=30
speed_average=300
speed_last=300
bytes_uploaded=1592342
bytes_total=3000000
files_uploaded=1
est_sec=45
uploadprogress-2.0.2/tests/mocks/get_info/upt_variation004.txt 0000644 0000765 0000024 00000000375 14125450113 023671 0 ustar ramsey staff upload_id=file005
fieldname=uploadFile
filename = a value with spaces in it
time_start=1579893044
time_last = 30
speed_average = 300
speed_last=300
bytes_uploaded =1592342
bytes_total=3000000
files_uploaded= 1
est_sec= 45
uploadprogress-2.0.2/tests/mocks/get_info/variation001 0000644 0000765 0000024 00000000325 14125450113 022153 0 ustar ramsey staff upload_id=file003
fieldname=uploadFile
filename=/path/to/tmp/filename.txt
time_start=1579893044
time_last=30
speed_average=300
speed_last=300
bytes_uploaded=1592342
bytes_total=3000000
files_uploaded=1
est_sec=45
uploadprogress-2.0.2/tests/bug58318.phpt 0000644 0000765 0000024 00000000672 14125450113 017175 0 ustar ramsey staff --TEST--
uploadprogress_get_info - Filename containing spaces (bug #58318)
--SKIPIF--
= 8) exit('skip test not valid on PHP 8');
--INI--
uploadprogress.get_contents = On
--FILE--
'file001',
'fieldname' => 'uploadFile',
'filename' => 'example.txt',
'time_start' => '1579893044',
'time_last' => '30',
'speed_average' => '300',
'speed_last' => '300',
'bytes_uploaded' => '1592342',
'bytes_total' => '3000000',
'files_uploaded' => '1',
'est_sec' => '45',
)
uploadprogress-2.0.2/tests/uploadprogress_get_info_error001.phpt 0000644 0000765 0000024 00000000663 14125450113 024364 0 ustar ramsey staff --TEST--
uploadprogress_get_info - Warns when too few arguments
--SKIPIF--
= 8) exit('skip test not valid on PHP 8');
--FILE--
'file003',
'fieldname' => 'uploadFile',
'filename' => '/path/to/tmp/filename.txt',
'time_start' => '1579893044',
'time_last' => '30',
'speed_average' => '300',
'speed_last' => '300',
'bytes_uploaded' => '1592342',
'bytes_total' => '3000000',
'files_uploaded' => '1',
'est_sec' => '45',
)
uploadprogress-2.0.2/tests/uploadprogress_get_info_variation002.phpt 0000644 0000765 0000024 00000000465 14125450113 025230 0 ustar ramsey staff --TEST--
uploadprogress_get_info - When empty template and identifier
--SKIPIF--
'file005',
'fieldname' => 'uploadFile',
'filename' => 'a value with spaces in it',
'time_start' => '1579893044',
'time_last' => '30',
'speed_average' => '300',
'speed_last' => '300',
'bytes_uploaded' => '1592342',
'bytes_total' => '3000000',
'files_uploaded' => '1',
'est_sec' => '45',
)
uploadprogress-2.0.2/config.m4 0000644 0000765 0000024 00000000650 14125450113 015453 0 ustar ramsey staff PHP_ARG_ENABLE([uploadprogress],
[whether to enable uploadprogress functions],
[AS_HELP_STRING([--enable-uploadprogress],
[Enable uploadprogress support [default=yes]])])
if test "$PHP_UPLOADPROGRESS" != "no"; then
PHP_SUBST(UPLOADPROGRESS_SHARED_LIBADD)
AC_DEFINE(HAVE_UPLOADPROGRESS, 1, [Whether the uploadprogress extension is enabled])
PHP_NEW_EXTENSION(uploadprogress, uploadprogress.c , $ext_shared)
fi
uploadprogress-2.0.2/config.w32 0000644 0000765 0000024 00000000372 14125450113 015547 0 ustar ramsey staff // vim:ft=javascript
ARG_ENABLE('uploadprogress' , 'The Upload Progress extension', 'no');
if (PHP_UPLOADPROGRESS != "no") {
EXTENSION("uploadprogress", "uploadprogress.c");
AC_DEFINE('HAVE_UPLOADPROGRESS', 1, 'The Upload Progress extension');
}
uploadprogress-2.0.2/php_uploadprogress.h 0000644 0000765 0000024 00000006424 14125450113 020042 0 ustar ramsey staff /*
+----------------------------------------------------------------------+
| Uploadprogress extension |
+----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.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@liip.ch) |
| Derived from: Doru Petrescu (pdoru-php-upm@kappa.ro) |
| http://pdoru.from.ro/upload-progress-meter/ |
+----------------------------------------------------------------------+
*/
#ifndef PHP_UPLOADPROGRESS_H
#define PHP_UPLOADPROGRESS_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include