Bug #10307 Updated: PHP refusing to get temporary file name from an HTTP PUT request.
| From: | briand at tps-eoltp dot com | Date: | Sun, 14 Jul 2002 23:15:58 +0000 |
| Subject: | Bug #10307 Updated: PHP refusing to get temporary file name from an HTTP PUT request. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-14165@lists.php.net to get a copy of this message | ||
ID: 10307
Updated by: briand@tps-eoltp.com
Reported By: excalibur@hub.org
Status: Open
Bug Type: HTTP related
Operating System: freebsd 4.2
PHP Version: 4.0.4pl1
New Comment:
I have duplicated this problem with PHP 4.2.1, on a Linux Mandrake
system
with an Apache 1.3 server. However, instead of a browser, I am
using the W3C libbwww sample program, put.c
(http://www.w3.org/Library/Examples/put.c). This is about as
"official" a PUT command as you can get.
For a server script, I have one that is about as simple as
you can get.
<?php
#copy($PHP_UPLOADED_FILE_NAME,"uploaded_file");
print "$PHP_UPLOADED_FILE_NAME";
?>
I've tried many variations, printing out $_POST and $_FILES,
and other variables, all with the same empty results.
Any new ideas?
Previous Comments:
------------------------------------------------------------------------
[2002-06-14 10:28:24] shiflett@php.net
Can any of you who are having this problem please provide an example of
the HTML form you are supporting with the PHP code you've provided?
Meaning, what is the markup and/or PHP code for the page that generates
the file upload?
I think I have an idea on this.
------------------------------------------------------------------------
[2002-06-11 16:23:28] ja@certiflexdimension.com
I can replicate the same issue with the sample code in the manual.
copy($PHP_UPLOADED_FILE_NAME,$DOCUMENT_ROOT.$REQUEST_URI);
I'm running Apache 1.3.24 with PHP 4.2.0, on RedHat 7.1... I'm guessing
this either got ignored, or the variable got removed. The header that
is returned just says:
Unable to open '' for reading: No such file or directory in <script
name> on line <line no>.
------------------------------------------------------------------------
[2002-02-11 18:33:45] steve.venable@lmco.com
Not sure if problem is documentation or PHP bug. Excalibur's example
to dump all variables duplicates my results, PHP doesn't provide
temporary filename for PUT data. Documentation says
"$PHP_PUT_FILENAME" and example uses "$PHP_UPLOADED_FILE_NAME" neither
of which are defined. It does work with CGI script as data to 'stdin'
but how do you read this in PHP? Platform is Solaris 8 with PHP 4.1 in
Apache 1.3.22
------------------------------------------------------------------------
[2001-05-23 10:04:04] excalibur@hub.org
This is a copy of all the versions we tried, none of them worked in the
slightest.
<?php
// copy($PHP_PUT_FILENAME,$DOCUMENT_ROOT.$REQUEST_URI);
$fp = fopen("/home/vhosts/farelist.com/www/update/log.txt","w+");
if(!copy ($PHP_PUT_FILENAME,
"/home/vhosts/farelist.com/www/update/test.txt")) {
fwrite($fp, "\n\ncopy failed\n\n");
} else {
fwrite($fp, "\n\ncopy successful\n\n");
}
$temp="PHP_PUT_FILENAME: $PHP_PUT_FILENAME\n";
$vars = get_defined_vars();
foreach ($vars as $test => $value) {
if (is_array($value)) {
foreach ($value as $subtest => $subvalue) {
$temp .= "$subtest: $subvalue\n";
}
} else {
$temp .= "$test: $value\n";
}
}
fwrite($fp, $temp);
$temp="DOCUMENT_ROOT: $DOCUMENT_ROOT\n";
fwrite($fp, $temp);
$temp="REQUEST_URI: $REQUEST_URI\n";
fwrite($fp, $temp);
fclose($fp);
?>
------------------------------------------------------------------------
[2001-05-19 12:14:51] jan@php.net
perhaps you can add a sample script for other to reproduce the
misbehaviour.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/10307
--
Edit this bug report at http://bugs.php.net/?id=10307&edit=1