私のアプリケーションでは、csvファイルをサーバーに送信する必要があります。次のコードを試しました
HttpPost httppost = new HttpPost(url);
InputStreamEntity reqEntity = new InputStreamEntity(
new FileInputStream(file), -1);
reqEntity.setContentType("binary/octet-stream");
reqEntity.setChunked(true); // Send in multiple parts if needed
httppost.setEntity(reqEntity);
HttpResponse response = httpclient.execute(httppost);
私のphpコードは..
<?php
if ($_FILES["detection"]["error"] > 0)
{
echo "Return Code: " . $_FILES["detection"]["error"] . "<br>";
}
そうしないと {
if (file_exists($_FILES["detection"]["name"]))
{
echo $_FILES["detection"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["detection"]["tmp_name"],$_FILES["detection"]["name"]);
echo "Stored in: ". $_FILES["detection"]["name"];
}
}
?>
エラーが発生しました
08-26 17:29:18.318: I/edit user profile(700):
08-26 17:29:18.318: I/edit user profile(700):注意: 未定義のインデックス: C:\xampp\htdocs\での検出sendreport.phpの4行目