Annotation of embedaddon/php/tests/basic/rfc1867_empty_upload.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: rfc1867 empty upload
! 3: --INI--
! 4: file_uploads=1
! 5: error_reporting=E_ALL&~E_NOTICE
! 6: comment=debug builds show some additional E_NOTICE errors
! 7: upload_max_filesize=1024
! 8: --POST_RAW--
! 9: Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
! 10: -----------------------------20896060251896012921717172737
! 11: Content-Disposition: form-data; name="foo"
! 12:
! 13:
! 14: -----------------------------20896060251896012921717172737
! 15: Content-Disposition: form-data; name="file1"; filename="file1.txt"
! 16: Content-Type: text/plain-file1
! 17:
! 18: 1
! 19: -----------------------------20896060251896012921717172737
! 20: Content-Disposition: form-data; name="file2"; filename=""
! 21: Content-Type: text/plain-file2
! 22:
! 23:
! 24: -----------------------------20896060251896012921717172737
! 25: Content-Disposition: form-data; name="file3"; filename="file3.txt"
! 26: Content-Type: text/plain-file3
! 27:
! 28: 3
! 29: -----------------------------20896060251896012921717172737--
! 30: --FILE--
! 31: <?php
! 32: var_dump($_FILES);
! 33: var_dump($_POST);
! 34: if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
! 35: var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
! 36: }
! 37: if (is_uploaded_file($_FILES["file3"]["tmp_name"])) {
! 38: var_dump(file_get_contents($_FILES["file3"]["tmp_name"]));
! 39: }
! 40: ?>
! 41: --EXPECTF--
! 42: array(3) {
! 43: [%u|b%"file1"]=>
! 44: array(5) {
! 45: [%u|b%"name"]=>
! 46: %string|unicode%(9) "file1.txt"
! 47: [%u|b%"type"]=>
! 48: %string|unicode%(16) "text/plain-file1"
! 49: [%u|b%"tmp_name"]=>
! 50: %string|unicode%(%d) "%s"
! 51: [%u|b%"error"]=>
! 52: int(0)
! 53: [%u|b%"size"]=>
! 54: int(1)
! 55: }
! 56: [%u|b%"file2"]=>
! 57: array(5) {
! 58: [%u|b%"name"]=>
! 59: %string|unicode%(0) ""
! 60: [%u|b%"type"]=>
! 61: %string|unicode%(0) ""
! 62: [%u|b%"tmp_name"]=>
! 63: %string|unicode%(0) ""
! 64: [%u|b%"error"]=>
! 65: int(4)
! 66: [%u|b%"size"]=>
! 67: int(0)
! 68: }
! 69: [%u|b%"file3"]=>
! 70: array(5) {
! 71: [%u|b%"name"]=>
! 72: %string|unicode%(9) "file3.txt"
! 73: [%u|b%"type"]=>
! 74: %string|unicode%(16) "text/plain-file3"
! 75: [%u|b%"tmp_name"]=>
! 76: %string|unicode%(%d) "%s"
! 77: [%u|b%"error"]=>
! 78: int(0)
! 79: [%u|b%"size"]=>
! 80: int(1)
! 81: }
! 82: }
! 83: array(1) {
! 84: [%u|b%"foo"]=>
! 85: %unicode|string%(0) ""
! 86: }
! 87: string(1) "1"
! 88: string(1) "3"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>