I'm currently creating a web service that receives files(images) and some other data.
The problem is how can PHP 'handle' it? I've read some articles saying i should use PUT method. How do you read it? http://input? POST? FILES?
I'm currently creating a web service that receives files(images) and some other data.
The problem is how can PHP 'handle' it? I've read some articles saying i should use PUT method. How do you read it? http://input? POST? FILES?
From Reference
<?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);
?>