File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / tests / basic / rfc1867_max_file_uploads_empty_files.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:06 2012 UTC (12 years, 5 months 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, v5_3_10, HEAD
php

    1: --TEST--
    2: rfc1867 max_file_uploads - empty files shouldn't count (non-debug version)
    3: --SKIPIF--
    4: <?php if(function_exists("leak")) print "skip only for non-debug builds"; ?>
    5: --INI--
    6: file_uploads=1
    7: error_reporting=E_ALL
    8: max_file_uploads=2
    9: --POST_RAW--
   10: Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
   11: -----------------------------20896060251896012921717172737
   12: Content-Disposition: form-data; name="file2"; filename=""
   13: Content-Type: text/plain-file
   14: 
   15: 
   16: -----------------------------20896060251896012921717172737
   17: Content-Disposition: form-data; name="file3"; filename=""
   18: Content-Type: text/plain-file
   19: 
   20: 33
   21: -----------------------------20896060251896012921717172737
   22: Content-Disposition: form-data; name="file4"; filename="file4.txt"
   23: Content-Type: text/plain-file
   24: 
   25: 
   26: -----------------------------20896060251896012921717172737
   27: Content-Disposition: form-data; name="file1"; filename="file1.txt"
   28: Content-Type: text/plain-file
   29: 
   30: 1
   31: -----------------------------20896060251896012921717172737--
   32: --FILE--
   33: <?php
   34: var_dump($_FILES);
   35: var_dump($_POST);
   36: if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
   37: 	var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
   38: }
   39: if (is_uploaded_file($_FILES["file4"]["tmp_name"])) {
   40: 	var_dump(file_get_contents($_FILES["file4"]["tmp_name"]));
   41: }
   42: ?>
   43: --EXPECTF--
   44: array(4) {
   45:   ["file2"]=>
   46:   array(5) {
   47:     ["name"]=>
   48:     string(0) ""
   49:     ["type"]=>
   50:     string(0) ""
   51:     ["tmp_name"]=>
   52:     string(0) ""
   53:     ["error"]=>
   54:     int(4)
   55:     ["size"]=>
   56:     int(0)
   57:   }
   58:   ["file3"]=>
   59:   array(5) {
   60:     ["name"]=>
   61:     string(0) ""
   62:     ["type"]=>
   63:     string(0) ""
   64:     ["tmp_name"]=>
   65:     string(0) ""
   66:     ["error"]=>
   67:     int(4)
   68:     ["size"]=>
   69:     int(0)
   70:   }
   71:   ["file4"]=>
   72:   array(5) {
   73:     ["name"]=>
   74:     string(9) "file4.txt"
   75:     ["type"]=>
   76:     string(15) "text/plain-file"
   77:     ["tmp_name"]=>
   78:     string(%d) "%s"
   79:     ["error"]=>
   80:     int(0)
   81:     ["size"]=>
   82:     int(0)
   83:   }
   84:   ["file1"]=>
   85:   array(5) {
   86:     ["name"]=>
   87:     string(9) "file1.txt"
   88:     ["type"]=>
   89:     string(15) "text/plain-file"
   90:     ["tmp_name"]=>
   91:     string(%d) "%s"
   92:     ["error"]=>
   93:     int(0)
   94:     ["size"]=>
   95:     int(1)
   96:   }
   97: }
   98: array(0) {
   99: }
  100: string(1) "1"
  101: string(0) ""

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