#23595 [Com]: File upload problems with arrays in HTML INPUT tags and register variables
ID: 23595
Comment by: carworks at hotmail dot com
Reported By: shb at widearea dot co dot uk
Status: Open
Bug Type: Variables related
Operating System: Linux and Solaris
PHP Version: 4.3.2RC3
New Comment:
I have the same problem on a openbsd 3.2 + php4.3.2 + Apache/1.3.26
when I run:
<html>
<?php var_dump($HTTP_POST_VARS,$HTTP_POST_FILES, $_REQUEST, $_POST) ;
echo "$_FILE[userfileA] <br>";
?>
<head>
<title>Files Upload</title>
</head>
<body>
<form action="tabel.php" method="post"
enctype="multipart/form-data">
<input type="hidden" name="Foo" value="tests">
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
Send this file: <input name="userfileA" type="file"><br>
And this one: <input name="userfileB" type="file"><br>
<input type="submit" value="Send File">
</form>
</body>
</html>
I get :
array(2) { ["Foo"]=> string(5) "tests" ["MAX_FILE_SIZE"]=>
string(6)
"100000" } array(0) { } array(2) { ["Foo"]=> string(5) "tests"
["MAX_FILE_SIZE"]=> string(6) "100000" } array(2) { ["Foo"]=>
string(5) "tests" ["MAX_FILE_SIZE"]=> string(6) "100000" }
But no vars for the file or the rest I upload/send ??
It works fine on openbsd 2.8 + Apache/1.3.19 + php 4.0.6
regards HT
Previous Comments:
------------------------------------------------------------------------
[2003-05-20 13:38:08] shb at widearea dot co dot uk
We have just compiled 4.3.2RC3 we still have this
problem.
Simon
------------------------------------------------------------------------
[2003-05-16 03:26:38] shb at widearea dot co dot uk
We just downloaded the snapshot php4-STABLE-
200305151530 and built a new httpd. We still have the
problem on our Solaris system -- we have not compiled
it for Linux.
------------------------------------------------------------------------
[2003-05-12 12:38:30] shb at widearea dot co dot uk
Assuming you have register variables enabled.
With 4.3.1, when you post from this HTML
<HTML>
<BODY><H1>filename and extra</H1>
<FORM METHOD="POST" ACTION="test.php"
ENCTYPE="multipart/form-data">
<INPUT TYPE="FILE" NAME="fields[filename]">
<INPUT TYPE="HIDDEN" NAME="fields[extra]" VALUE="fred">
<INPUT TYPE="SUBMIT">
</FORM>
</BODY>
</HTML>
to this:
<?php
var_dump($fields) ;
?>
you get this:
array(1) { ["extra"]=> string(4) "fred" }
If you use this HTML:
<HTML>
<BODY><H1>filename </H1>
<FORM METHOD="POST" ACTION="test.php"
ENCTYPE="multipart/form-data">
<INPUT TYPE="FILE" NAME="fields[filename]">
<INPUT TYPE="SUBMIT">
</FORM>
</BODY>
</HTML>
you get this:
array(1) { ["filename"]=> string(14) "/tmp/phpSsMqed" }
If you use the first file on PHP 4.2.3 you get the response which we
believe is correct which is:
array(2) { ["filename"]=> string(18) "/var/tmp/php7xaWYL"
["extra"]=>
string(4) "fred" }
The bug occurs on both our Linux RH 8.0 and Solaris 7/8 systems. We
have not tried 4.3.2 pre-releases -- it has taken us long enough to
find the problem!
There are similar bug reports on old versions but we think that the
transition from 4.2.3 to 4.3.1 has changed something.
Regards,
Simon.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23595&edit=1
Thread (8 messages)