|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-08-18 14:19 UTC] scott at aubrey dot org dot uk
Description:
------------
The built in web server does not handle file uploads, instead throwing an error.
This is a fairly clean build of alpha 3.
Test script:
---------------
<?php
var_dump($_SERVER);
?>
<form enctype="multipart/form-data" method="post">
<label for="filename">Select a file to upload:</label><br>
<input type="file" id="file" name="file">
<br><br>
<input type="submit" name="action" value="Upload">
</form>
Expected result:
----------------
array(1) { ["file"]=> array(5) { ["name"]=> string(7) "testupload.txt" ["type"]=>
string(10) "text/plain" ["tmp_name"]=> string(26) "/private/var/tmp/phpynOZom"
["error"]=> int(0) ["size"]=> int(12) } }
Actual result:
--------------
array(0) { }
--
Error log throws:
PHP Warning: Missing boundary in multipart/form-data POST data in Unknown on
line 0
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 03:00:01 2025 UTC |
this should due to the following code in sapi/cli/php_cli_server.c 2161 : php_cli_server_client_populate_request_info: ... { char **val; const char delimiter[] = ";"; if (SUCCESS == zend_hash_find(&client->request.headers, "Content-Type", sizeof("Content-Type"), (void**)&val)) { request_info->content_type = strtok(*val, delimiter); } } ... which erased the boundary content of "multipart/form-data; boundary=----****",