Fort some reason it looks as if this message never got posted with a body ...

dg

Begin forwarded message:

From: David G. Simmons <[EMAIL PROTECTED]>
Date: April 13, 2004 5:16:40 PM PDT
To: [EMAIL PROTECTED]
Subject: Help! Reading from stdin

Please respond directly, as I'm only on the digest and need an answer ASAP!

I'm trying to read a file (currently sent to me via curl) and am having trouble. It worked once or twice, but not anymore.

The curl command could be either:

curl --data-binary <file-name> http://hostname/reader.php

OR

curl http://hostname/reader.php -T <file-name>

Neither seem effective.

I have tried (all from the php online docs):

if(!isset($GLOBALS['StdinPointer'])){
$GLOBALS['StdinPointer'] = fopen("php://stdin", "r");
} else die("Don't have stdin!\n");

And it does not die. So stdin is open. BUT:

do {
$data = fread($GLOBALS['StdinPointer'], 8192);
$data = fread($fpf, 8192);
if (strlen($data) == 0) {
echo "got no data!\n";
break;
}
$contents .= $data;
echo $data;
} while (true);

gets NOTHING.

So I tried:

if($DEBUG) echo "_FILES: " . print_r($_FILES);
echo "Userfile: " . $_FILES['userfile'] . "\n";
if($DEBUG) echo "HTTP_POST_FILES: " . print_r($HTTP_POST_FILES);
$uploaddir = '/tmp/';
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile);

Thinking maybe the file was being sent as a POST ... but this ALSO gets nothing ...

I cannot figure out what's wrong, and would appreciate ANY help!!!

dg

--
David G. Simmons
Calvin Says:
"No, thanks. I'm trying to reach middle age."
-'Dad'
--
David G. Simmons
Calvin Says:
"I never get to do anything fun."
-Calvin

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to