File: put.php

package info (click to toggle)
openms 2.4.0-real-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 646,136 kB
  • sloc: cpp: 392,260; xml: 215,373; python: 10,976; ansic: 3,325; php: 2,482; sh: 901; ruby: 399; makefile: 141; perl: 85
file content (19 lines) | stat: -rw-r--r-- 437 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
/* 
   PUT data comes in on the stdin stream, which is php://input
   for PHP compiled as a module, although most documentation claim
   it's php://stdin
*/
$putdata = fopen("php://input", "r");
$fp = fopen("m2.bmp", "w");
$i = 0;
while ($data = fread($putdata, 1024))
{
    echo "data pass: " . $i++ . "\n";
    fwrite($fp, $data);
}
fflush($fp);
fclose($fp);
fclose($putdata);
copy("m2.bmp", $request_uri);
?>