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