php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #4335 Missing variable in $HTTP_POST_VARS when uploading a file through a form
Submitted: 2000-05-05 04:51 UTC Modified: 2001-02-10 14:18 UTC
From: noor at comrax dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 3.0.16 OS: FreeBSD 4.0-STABLE
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: noor at comrax dot com
New email:
PHP Version: OS:

 

 [2000-05-05 04:51 UTC] noor at comrax dot com
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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-10 14:18 UTC] jimw@php.net
addressed in 4.0 with HTTP_POST_FILES.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 19:01:28 2025 UTC