0
私はアンドロイドから写真を撮ってPHP Webサービスで送信しています。php web serviesを使ってアンドロイドからmongodbに画像をアップロードするには
私はこのコードを使用しています: -
<?php
//creating mongodb database connection
$m = new MongoClient();
$db = $m->companydb;
$grid= $db->getGridFS('myGrid');
//creating for request
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
$pic = $_POST['image'];
//uploading in mongodb database
// we are getting error in this line -->This function work properly when
we are taking image from html file and use this command
//storeUpload('image'); but in this file first we are string in a variable
and then passing this variable using storeUpload function
// maybe thats why we are geeting this issue
$grid->storeUpload($pic);
echo "Successfully Uploaded";
}
else{
echo "please check the REQUEST_METHOD";
}
?>
を誰がどのようにそれをアップロードする方法を教えてくださいすることができます。
[PHPを使用したファイルのアップロード](http://stackoverflow.com/questions/35253550/upload-a-file-using-php)の可能な複製 – Jer