我正在创建一个接收文件(图像)和其他数据的Web服务。PHP:重新处理上传的文件
问题是PHP如何处理它?我读过一些文章,说我应该使用PUT方法。你如何阅读它? http://input? POST?文件?
我正在创建一个接收文件(图像)和其他数据的Web服务。PHP:重新处理上传的文件
问题是PHP如何处理它?我读过一些文章,说我应该使用PUT方法。你如何阅读它? http://input? POST?文件?
<?php
/* PUT data comes in on the stdin stream */
$putdata = fopen("php://input", "r");
/* Open a file for writing */
$fp = fopen("myputfile.ext", "w");
/* Read the data 1 KB at a time
and write to the file */
while ($data = fread($putdata, 1024))
fwrite($fp, $data);
/* Close the streams */
fclose($fp);
fclose($putdata);
?>
有用的问题:http://stackoverflow.com/questions/359047/php-detecting-request-type-get-post-put-or-delete – diEcho 2012-01-03 05:25:25
@diEcho感谢的人。但我已经知道了。只是处理上传的文件。 – sheeks06 2012-01-04 04:10:48