PUT uploads

From: Date: Fri, 17 Jan 2003 23:03:59 +0000
Subject: PUT uploads
Groups: php.general 
Request: Send a blank email to php-general+get-132055@lists.php.net to get a copy of this message
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

« previous php.general (#132055) next »