You are here: PHP 4.2.2 and php://stdin « PHP Programming Language « IT news, forums, messages
PHP 4.2.2 and php://stdin

Posted by Stelios G. Sfakianakis on 09/08/05 14:27

Hello,
I am using php 4.2.2 in Red Hat 9.0 with apache 2.0.40 I try to build a
php script that accepts POST requests that contain multimedia data and
shoves them in a MySQL database. My problem is that it seems that I
cannot read the POST data from stdin.

I created the following php script to test it:

<?php

$in = fopen("php://stdin", "rb");
$line = fread($in, 10);
echo "Content-type: text/plain\n\n";
echo "len=".strlen($line)." OK\n";

?>

and however I try to POST a file either with cURL (curl --data-binary
@file http://....) or with netcat (nc host port, ...) what I get back is

len=0 OK

i.e. no data are read!

Any ideas?
Thanks!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация