In my application i have to send the csv file to server i tried the following code
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);
and my php code is..
<?php
if ($_FILES["detection"]["error"] > 0)
{
echo "Return Code: " . $_FILES["detection"]["error"] . "<br>";
}
else {
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"];
}
}
?>
i got the error that
08-26 17:29:18.318: I/edit user profile(700):
08-26 17:29:18.318: I/edit user profile(700): Notice: Undefined index: detection in C:\xampp\htdocs\sendreport.php on line 4