rfc1867_array_upload.phpt 1.7 KB

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