ID: 46485
User updated by: nyaka at nyaka dot com
Reported By: nyaka at nyaka dot com
Status: Bogus
Bug Type: Apache2 related
Operating System: Solaris 10
PHP Version: 5.2.6
New Comment:
I understand that POST handler deletes temporary file, but should it
delete if AFTER the actual php script is executed? The temporary file
cannot be accessed from the php script. It is visible from the trace I
provided and from dump of $_FILES variable.
Previous Comments:
------------------------------------------------------------------------
[2008-11-04 21:45:09] lbarnaud@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
> [error] => 3
On error, the POST handler deletes the temporary file.
Please see http://www.php.net/manual/en/features.file-upload.php
------------------------------------------------------------------------
[2008-11-04 21:35:14] nyaka at nyaka dot com
Description:
------------
I'm trying to upload a file with PHP 5.2.6 and Apache 2.2.9 from a
custom application. It worked for me previously with Apache 1.3 and PHP
4.3.
I also tried to use PHP 5.2.7RC3-dev (cli) (built: Nov 4 2008
20:43:51). Same results.
Reproduce code:
---------------
<?php
error_log(print_r($_FILES, TRUE));
?>
Expected result:
----------------
I expect the file to be uploaded and $_FILES array to contain correct
data about that file and not an error message.
Actual result:
--------------
This is from the apache error log:
Array
(
[wav] => Array
(
[name] => msg-94_48972.wav
[type] =>
[tmp_name] =>
[error] => 3
[size] => 0
)
)
This is trace of httpd with truss:
.......
8469: read(23, " P O S T / v o i c e m".., 8000) = 4344
8469: stat64("/share/web/snom/voicemail.php", 0x08047880) = 0
.......
8469: time() = 1225822869
8469: resolvepath("/tmp", "/tmp", 1024) = 4
8469: getpid() = 8469 [8463]
8469: lstat64("/tmp/phpjFaOIq", 0x08044800) Err#2 ENOENT
8469: open("/tmp/phpjFaOIq", O_RDWR|O_CREAT|O_EXCL, 0600) = 24
8469: write(24, " R I F F92 6\0\0 W A V E".., 5119) = 5119
8469: write(24, " nDCB895EA04 69A1C I n '".., 5119) = 5119
8469: read(23, " nD504 H8EE3C8 rCB\0B691".., 8000) = 2346
8469: write(24, " 2C4E215B9 aD6 <E6 J aD9".., 3779) = 3779
8469: close(24) = 0
8469: unlink("/tmp/phpjFaOIq") = 0
.......
8469: resolvepath("/share/web/snom/voicemail.php",
"/share/web/snom/voicemail.php", 1024) = 29
8469: open("/share/web/snom/voicemail.php", O_RDONLY) = 25
.......
I can see here that the temporary file is actually created and the data
is written to it. But after the file is closed an unlink is executed.
I can provide TCP dump if necessary.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46485&edit=1