note 72382 rejected from wrappers by nlopess
| From: | nlopess@php.net | Date: | Wed, 17 Jan 2007 23:13:31 +0000 |
| Subject: | note 72382 rejected from wrappers by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-121864@lists.php.net to get a copy of this message | ||
Note Submitter: shaon dot cse99 dot cuet at gmail dot com
----
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]