rfc1867.phpt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. --TEST--
  2. session rfc1867
  3. --INI--
  4. file_uploads=1
  5. upload_max_filesize=1024
  6. session.save_path=
  7. session.name=PHPSESSID
  8. session.use_strict_mode=0
  9. session.use_cookies=1
  10. session.use_only_cookies=0
  11. session.upload_progress.enabled=1
  12. session.upload_progress.cleanup=0
  13. session.upload_progress.prefix=upload_progress_
  14. session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS
  15. session.upload_progress.freq=1%
  16. session.upload_progress.min_freq=0.000000001
  17. session.save_handler=files
  18. --EXTENSIONS--
  19. session
  20. --SKIPIF--
  21. <?php include('skipif.inc'); ?>
  22. --COOKIE--
  23. PHPSESSID=rfc1867
  24. --GET--
  25. PHPSESSID=rfc1867-get
  26. --POST_RAW--
  27. Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
  28. -----------------------------20896060251896012921717172737
  29. Content-Disposition: form-data; name="PHPSESSID"
  30. rfc1867-post
  31. -----------------------------20896060251896012921717172737
  32. Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS"
  33. rfc1867.php
  34. -----------------------------20896060251896012921717172737
  35. Content-Disposition: form-data; name="file1"; filename="file1.txt"
  36. 1
  37. -----------------------------20896060251896012921717172737
  38. Content-Disposition: form-data; name="file2"; filename="file2.txt"
  39. 2
  40. -----------------------------20896060251896012921717172737--
  41. --FILE--
  42. <?php
  43. session_start();
  44. var_dump(session_id());
  45. var_dump(basename(__FILE__) == $_POST[ini_get("session.upload_progress.name")]);
  46. var_dump($_FILES);
  47. var_dump($_SESSION["upload_progress_" . basename(__FILE__)]);
  48. session_destroy();
  49. ?>
  50. --EXPECTF--
  51. string(%d) "rfc1867"
  52. bool(true)
  53. array(2) {
  54. ["file1"]=>
  55. array(6) {
  56. ["name"]=>
  57. string(9) "file1.txt"
  58. ["full_path"]=>
  59. string(9) "file1.txt"
  60. ["type"]=>
  61. string(0) ""
  62. ["tmp_name"]=>
  63. string(%d) "%s"
  64. ["error"]=>
  65. int(0)
  66. ["size"]=>
  67. int(1)
  68. }
  69. ["file2"]=>
  70. array(6) {
  71. ["name"]=>
  72. string(9) "file2.txt"
  73. ["full_path"]=>
  74. string(9) "file2.txt"
  75. ["type"]=>
  76. string(0) ""
  77. ["tmp_name"]=>
  78. string(%d) "%s"
  79. ["error"]=>
  80. int(0)
  81. ["size"]=>
  82. int(1)
  83. }
  84. }
  85. array(5) {
  86. ["start_time"]=>
  87. int(%d)
  88. ["content_length"]=>
  89. int(%d)
  90. ["bytes_processed"]=>
  91. int(%d)
  92. ["done"]=>
  93. bool(true)
  94. ["files"]=>
  95. array(2) {
  96. [0]=>
  97. array(7) {
  98. ["field_name"]=>
  99. string(5) "file1"
  100. ["name"]=>
  101. string(9) "file1.txt"
  102. ["tmp_name"]=>
  103. string(%d) "%s"
  104. ["error"]=>
  105. int(0)
  106. ["done"]=>
  107. bool(true)
  108. ["start_time"]=>
  109. int(%d)
  110. ["bytes_processed"]=>
  111. int(1)
  112. }
  113. [1]=>
  114. array(7) {
  115. ["field_name"]=>
  116. string(5) "file2"
  117. ["name"]=>
  118. string(9) "file2.txt"
  119. ["tmp_name"]=>
  120. string(%d) "%s"
  121. ["error"]=>
  122. int(0)
  123. ["done"]=>
  124. bool(true)
  125. ["start_time"]=>
  126. int(%d)
  127. ["bytes_processed"]=>
  128. int(1)
  129. }
  130. }
  131. }