[PHP-DEV] Bug #4335: Missing variable in $HTTP_POST_VARS when uploading a file through a form From: noor <email protected>
Date: 05/05/00

From: noor <email protected>
Operating system: FreeBSD 4.0-STABLE
PHP version: 3.0.16
PHP Bug Type: Feature/Change Request
Bug description: Missing variable in $HTTP_POST_VARS when uploading a file through a form

Do the following simple steps to reproduce the problem:

In index.html put:
------------------
<html>

<body>
<form method="post" action="phpinfo.php" enctype="multipart/form-data">

<p><input type="file" name="FileVariable" size="30"></p>
<p><input type="submit" value="Send File"></p>

</form>
</body>

</html>

In phpinfo.php put:
-------------------
<? phpinfo( ); ?>

Now, go to index.html and press Browse to select a file from your hark drive. Then, press the "Send File" button.

After you've submitted the form, scroll down to "PHP Variables" section, and notice that there are 4 variables, which are:

PHP_SELF
HTTP_POST_VARS["FileVariable_name"]
HTTP_POST_VARS["FileVariable"]
HTTP_POST_VARS["FileVariable_size"]

Have you noticed already? Where is the HTTP_POST_VARS["FileVariable_type"] variable?

I know I can access it through $FileVariable_type, but it is more secured to access it through HTTP_POST_VARS["FileVariable_type"] when I know that the form uses POST method.

Thank you for your help.

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>