Jump to content

php://input stream


enridp

Recommended Posts

Hi ! I'm trying to understand how php://input works.

I've read the manual ( http://php.net/manual/en/wrappers.php.php ) and I have an example of a file upload receiving the file with php://input instead of $_FILES.

 

But I can't understand it, does somebody a good tutorial about php://input ?

 

What is the data inside it? is always the same that $HTTP_RAW_POST_DATA ?

 

How can we send a file to PHP and receive it with php://input ?

 

I'm trying to see what's inside php://input with this code:

$in = fopen("php://input", "rb");
		echo Debug::vars($in);
		if ($in) 
		{
			while ($buff = fread($in, 4096))
			{
				echo $buff . EOL;
				// fwrite($out, $buff);
			}
		} 

 

but I get always blank output (Debug is a Kohana class and it returns:

resource(stream) php://input

 

Thanks !!

Link to comment
https://forums.phpfreaks.com/topic/232610-phpinput-stream/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.