I am trying to receive some image data in php using $_POST if I am trying to post small string like "abc" I am getting the response but when I try to post huge data like 108 KB it's not showing the response might be I need to increase some limit but I don't have access in php.ini file.
is there any other way?
And I am posting the data from android so is there any string shorten encoding in android and decoding in php available. I already used base64 to get the image data.
My php code to echo the return.
<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type');
if(isset($_POST['incidentDetails']))
{
echo 'Responce from server: ' . $_POST['incidentDetails'];
}
else
{
echo 'Request without paramenter';
}
?>
The url - http://bumba27.byethost16.com/incidentManagments/api/adding_incident_details.php
I need to post as parameter name incidentDetails- http://www.filedropper.com/log_2
Android Code
// Create a new HttpClient and Post Header
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://bumba27.byethost16.com/incidentManagments/api/adding_incident_details.php");
try
{
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
nameValuePairs.add(new BasicNameValuePair("incidentDetails", headerData));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
responseCode = response.getStatusLine().getStatusCode();
responseBody = EntityUtils.toString(response.getEntity());
}
catch (Throwable t )
{
Log.d("Error Time of Login",t+"");
}