Annotation of embedaddon/php/ext/standard/tests/file/is_uploaded_file_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: is_uploaded_file() function
3: --CREDITS--
4: Dave Kelsey <d_kelsey@uk.ibm.com>
5: --POST_RAW--
6: Content-type: multipart/form-data, boundary=AaB03x
7:
8: --AaB03x
9: content-disposition: form-data; name="field1"
10:
11: Joe Blow
12: --AaB03x
13: content-disposition: form-data; name="pics"; filename="file1.txt"
14: Content-Type: text/plain
15:
16: abcdef123456789
17: --AaB03x--
18: --FILE--
19: <?php
20: // uploaded file
21: var_dump(is_uploaded_file($_FILES['pics']['tmp_name']));
22:
23: // not an uploaded file
24: var_dump(is_uploaded_file($_FILES['pics']['name']));
25:
26: // not an uploaded file
27: var_dump(is_uploaded_file('random_filename.txt'));
28:
29: // not an uploaded file
30: var_dump(is_uploaded_file('__FILE__'));
31:
32: // Error cases
33: var_dump(is_uploaded_file());
34: var_dump(is_uploaded_file('a', 'b'));
35:
36: ?>
37: --EXPECTF--
38: bool(true)
39: bool(false)
40: bool(false)
41: bool(false)
42:
43: Warning: is_uploaded_file() expects exactly 1 parameter, 0 given in %s on line %d
44: NULL
45:
46: Warning: is_uploaded_file() expects exactly 1 parameter, 2 given in %s on line %d
47: NULL
48:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>