php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26423 Queries Regarding PHP 4.3.3
Submitted: 2003-11-26 08:55 UTC Modified: 2003-11-26 08:59 UTC
From: prashant at goodhealthnyou dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.3 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: prashant at goodhealthnyou dot com
New email:
PHP Version: OS:

 

 [2003-11-26 08:55 UTC] prashant at goodhealthnyou dot com
Description:
------------
Hi,

There are some queries regarding PHP 4.1.As you mentioned in php 4.1
register_globals=off. are set for security reasons.

Is it Required to have Form attribute  as enctype="multipart/form-data" if i
have a File Upload on the Particular Form.

<form name=form1 action="test.php3" method="Post"
enctype="multipart/form-data">
i.e <input type=file name=filename>

I am Facing a Problem as when i am removing the enctype attribute in Form
object, i am able to pass form values data
from one form to another form i.e the destination form will able to retrieve
the form values, but from the source form when i keep the enctype attribute
in the source form object, i am unable to pass the values i.e the
destination form is unable to retrieve
the values passed from source form.

Second Problem is I am unable to retrieve the image name using
$_FILES['filename']['name']; in the Destination form.
The source form has the file upload html tag

<form name=form1 action="test.php3" method="Post"
enctype="multipart/form-data">
i.e <input type=file name=filename>
<input type=submit value=submit>

Awaiting Your Prompt Reply,

Thanks & Regards,
Prashant S Akerkar




Reproduce code:
---------------
Source file 

source.php3

<form enctype="multipart/form-data" name = "doctor" action="dest.php3" method=post onSubmit = "return checkall(this)" >

<input type=file name="image1">
<input type="submit" name="submit" value="Submit">

</form>

Destination File

dest.php3

echo $_FILES['image1']['name'];
echo $_FILES['image1']['type'];
echo $_FILES['image1']['error'];
echo $HTTP_POST_FILES['image1']['name']; 
echo $HTTP_POST_FILES['image1']['type']; 
echo $HTTP_POST_FILES['image1']['size']; 

copy ("$image1","../../../".$coname."/".$_POST['logname']."/".$image1_name);					


Expected result:
----------------
The File Upload doesn't Work. The name of the File Uploaded is not printed here as shown in the code.

Warning: Unable to open 'D:\\Prashant\\Novartisimages\\cropped\\69.jpg' for reading: No such file or directory 


Actual result:
--------------

The file upload should work i.e file should get uploaded on the web server as well as all form objects data should get passed from source to destination file.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-26 08:59 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

This is not a support forum.
 [2003-12-01 11:46 UTC] sw at telemeida dot ch
i have seen severe simmilar bug reports and i run into exactly the same problem.

Environment:
------------
PHP Version 4.3.3 (cobalt RH linux)
Server API 	Apache
Apache Version 	Apache/1.3.20
Apache Release 	10320100
Apache API Version 	19990320

PHP config:
-----------
file_uploads	On	On
gpc_order	GPC	GPC
post_max_size	8M	8M
safe_mode	Off	Off
upload_tmp_dir	/home/tmp	/home/tmp (does exist and is set to 777, session handling uses the same dir and session files are written, session handling works propperly )
upload_max_filesize	2M	2M


Example code:
-------------
<?php 
	print("<pre>");
	print_r($_FILES);
	print("</pre><hr/>");
?>

<form method="post" 
      enctype="multipart/form-data"
      action="<?=basename(__FILE__)?>" >
	<input type="file" name="blah"><br>
	<input type="submit">
</form>


Expected result (tested with a 1K ascii file):
----------------------------------------------
Array(
  'blah' => Array(
    'name' => 'test.txt',
    'type' => 'text/plain',
    'size' => 'a few bytes',
    'tmp_name' => '/home/tmp/...whatever..',
    'error' => ''
  )
)


Actual Result:
--------------
Array()


iv'e done quiet some RTFM and i am pretty sure there is no configuration problem. All file uploads scripts work well with php 4.2.x and and with $HTTP_POST_FILES in pre 4.1 versions, the problem appeared with the use of a 4.3+ php version.

Can anybody confirm that this is a bug (or not) ? Any help is highly appreciated.

Cheers,
Simon
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 02:01:33 2024 UTC