note 72382 added to wrappers
| From: | shaon dot cse99 dot cuet at gmail dot com | Date: | Wed, 17 Jan 2007 00:34:03 +0000 |
| Subject: | note 72382 added to wrappers | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121821@lists.php.net to get a copy of this message | ||
Is it possible to read contents in file upload with php://stdin. I tried with the code but failed:
[php]
<?php
/* PUT data comes in on the stdin stream */
$putdata = fopen("php://stdin", "r");
/* Open a file for writing */
$fname=rand(1000000,9999999).".txt";
$fp = fopen("C:/apache2triad/htdocs/fdc/xupl/$fname", "w");
/* Read the data 1 KB at a time
and write to the file */
$n=0;
while ($data = fread($putdata, 1024)){
//fwrite($fp, $data);
echo $data;
$n++;
if($n>2) die("END");
}
/* Close the streams */
fclose($fp);
fclose($putdata);
?>
[/php]
----
Server IP: 61.195.146.164
Probable Submitter: 203.80.179.21
----
Manual Page -- http://www.php.net/manual/en/wrappers.php
Edit -- https://master.php.net/note/edit/72382
Del: integrated -- https://master.php.net/note/delete/72382/integrated
Del: useless -- https://master.php.net/note/delete/72382/useless
Del: bad code -- https://master.php.net/note/delete/72382/bad+code
Del: spam -- https://master.php.net/note/delete/72382/spam
Del: non-english -- https://master.php.net/note/delete/72382/non-english
Del: in docs -- https://master.php.net/note/delete/72382/in+docs
Del: other reasons-- https://master.php.net/note/delete/72382
Reject -- https://master.php.net/note/reject/72382
Search -- https://master.php.net/manage/user-notes.php