Hi everyone.

I'm trying to get my PUT method upload to work.
I tried the using the script from the manual, but it
creates an empty file.
<?php
/* PUT data comes in on the stdin stream */
$putdata = fopen("php://stdin","r");

/* Open a file for writting */
$fp = fopen("myputfile.ext","w");

/* Read the data 1kb at a time
   and write to the file */
while ($data = fread($putdata,1024))
  fwrite($fp,$data);

/* Close the streams */
fclose($fp);
fclose($putdata);
?>

then i tried to sniff on the bugs.php.net
(http://bugs.php.net/bug.php?id=14298)
site and i found this:

$in = fopen("php://input","rb");
$out = fopen($outfile,"wb");
while(!feof($in)) {
  fwrite($out, fread($in, $bufsize));
}
fclose($in);
fclose($out);
but that doens't work too...the headers i get are correct:
Accept:
www/source, text/html, video/mpeg, image/jpeg, image/x-tiff, image/x-rgb,
image/x-xbm, image/gif, */*, application/postscript
Content-Length:
21504
Content-type: application/x-www-form-urlencodedHost: zenderx

the length of my file is ok.

My question is that... Is this new method of handling uploads already
working?
How can I handle this kind of upload?

Regards

--
Chris Jarecki
Web Developer
Prograf Net Partners
http://www.pnp.pl/

ICQ: 47650101



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to