File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / tests / basic / rfc1867_empty_upload.phpt
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:34:34 2012 UTC (12 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, HEAD
php 5.4.3+patches

    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: max_file_uploads=10
    9: --POST_RAW--
   10: Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
   11: -----------------------------20896060251896012921717172737
   12: Content-Disposition: form-data; name="foo"
   13: 
   14: 
   15: -----------------------------20896060251896012921717172737
   16: Content-Disposition: form-data; name="file1"; filename="file1.txt"
   17: Content-Type: text/plain-file1
   18: 
   19: 1
   20: -----------------------------20896060251896012921717172737
   21: Content-Disposition: form-data; name="file2"; filename=""
   22: Content-Type: text/plain-file2
   23: 
   24: 
   25: -----------------------------20896060251896012921717172737
   26: Content-Disposition: form-data; name="file3"; filename="file3.txt"
   27: Content-Type: text/plain-file3
   28: 
   29: 3
   30: -----------------------------20896060251896012921717172737--
   31: --FILE--
   32: <?php
   33: var_dump($_FILES);
   34: var_dump($_POST);
   35: if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
   36: 	var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
   37: }
   38: if (is_uploaded_file($_FILES["file3"]["tmp_name"])) {
   39: 	var_dump(file_get_contents($_FILES["file3"]["tmp_name"]));
   40: }
   41: ?>
   42: --EXPECTF--
   43: array(3) {
   44:   [%u|b%"file1"]=>
   45:   array(5) {
   46:     [%u|b%"name"]=>
   47:     %string|unicode%(9) "file1.txt"
   48:     [%u|b%"type"]=>
   49:     %string|unicode%(16) "text/plain-file1"
   50:     [%u|b%"tmp_name"]=>
   51:     %string|unicode%(%d) "%s"
   52:     [%u|b%"error"]=>
   53:     int(0)
   54:     [%u|b%"size"]=>
   55:     int(1)
   56:   }
   57:   [%u|b%"file2"]=>
   58:   array(5) {
   59:     [%u|b%"name"]=>
   60:     %string|unicode%(0) ""
   61:     [%u|b%"type"]=>
   62:     %string|unicode%(0) ""
   63:     [%u|b%"tmp_name"]=>
   64:     %string|unicode%(0) ""
   65:     [%u|b%"error"]=>
   66:     int(4)
   67:     [%u|b%"size"]=>
   68:     int(0)
   69:   }
   70:   [%u|b%"file3"]=>
   71:   array(5) {
   72:     [%u|b%"name"]=>
   73:     %string|unicode%(9) "file3.txt"
   74:     [%u|b%"type"]=>
   75:     %string|unicode%(16) "text/plain-file3"
   76:     [%u|b%"tmp_name"]=>
   77:     %string|unicode%(%d) "%s"
   78:     [%u|b%"error"]=>
   79:     int(0)
   80:     [%u|b%"size"]=>
   81:     int(1)
   82:   }
   83: }
   84: array(1) {
   85:   [%u|b%"foo"]=>
   86:   %unicode|string%(0) ""
   87: }
   88: string(1) "1"
   89: string(1) "3"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>