php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #14298 PUT method not supported in PHP 4
Submitted: 2001-11-30 10:33 UTC Modified: 2003-08-11 15:18 UTC
Votes:12
Avg. Score:4.8 ± 0.6
Reproduced:11 of 11 (100.0%)
Same Version:5 (45.5%)
Same OS:4 (36.4%)
From: Information-Cascade at ntlworld dot com Assigned: hholzgra (profile)
Status: Closed Package: Documentation problem
PHP Version: 4.0.6 OS:
Private report: No CVE-ID: None
 [2001-11-30 10:33 UTC] Information-Cascade at ntlworld dot com
Document:
	features.file-upload.put-method.html
SAYS:
	The filename of this temporary file is in the
	$PHP_PUT_FILENAME variable
SAYS:
	copy(
		$PHP_UPLOADED_FILE_NAME,
		$DOCUMENT_ROOT.$REQUEST_URI
	);

Neither works. What does?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-02 01:32 UTC] zak@php.net
Thanks for the report - I am checking into it.

--zak

 [2002-05-03 12:15 UTC] jimmy at lusidor dot com
Whats happening on this subject?
 [2002-05-08 09:44 UTC] zak@php.net
Current status on this is that I ignored it for a while - 
I am taking a look at it again.

 [2002-05-09 07:55 UTC] jimmy at lusidor dot com
If you find the temporary file variable I would be much obliged if you could drop me a line.

BTW I was thinking would'nt it be better to have the PUT values in the superglobal $_FILES ? Or at least in a $HTTP_PUT_FILE var.

A possible solution could be something like the following:

$HTTP_PUT_FILE['request_uri']
Path of the proposed upload like /mytest/filename.htm

$HTTP_PUT_FILE['path_translated']
The full path of the proposed upload like /usr/home/foo/bar/public_html/mytest/filename.htm

$HTTP_PUT_FILE['size']
The size, in bytes, of the uploaded file. 

$HTTP_PUT_FILE['tmp_name']
Temp name something like /tmp/hfdhjfufd8733

My only bad is that I cant program in C otherwise I would have been there doing it already.
 [2002-05-13 08:27 UTC] jimmy at lusidor dot com
Just wanted to drop a note about a test I've done:

I tried a simple perl script getting the PUT file and it worked.

Calling the same script through PHP yields "no file" meaning that PHP does something the uploaded file since the perlscript used by itself works and then called through PHP does'nt.
 [2002-11-12 07:41 UTC] hholzgra@php.net
this is a PHP 3 only feature 
that noone ever ported to PHP 4 ...

with 4.3 you will be able to read
the PUT data from the php://input stream

as the $PHP_PUT stuff in PHP 3 seems to
be something almost never used and as 
the new streams solution is so easy to 
use i think it is not worth to port the
PHP 3 feature here ...

in 4.3 you will be able to just do a

$in = fopen("php://input","rb");
$out = fopen($outfile,"wb");
while(!feof($in)) {
  fwrite($out, fread($in, $bufsize));
}
fclose($in);
fclose($out);

no nead to deal with temporary files,
no disk space wasted when the script
doesn't need the PUT data, and the
approach is not limited to PUT requests
but will work with all HTTP methods
carrying content

changed to documentation problem
 [2002-12-01 23:58 UTC] pollita@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

Provided example of using php://stdin and note re: change from PHP3.
 [2002-12-07 06:47 UTC] goba@php.net
Once again, this is an ASSIGNED bug, do not play with this pollita, please.
 [2002-12-26 06:38 UTC] om671 at aol dot com
is my system being buged
 [2003-08-11 15:18 UTC] hholzgra@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 20:01:27 2024 UTC