rfc1867_array_upload.phpt 1.5 KB

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