how to store images into file_managed table from android to drupal I have tried calling Drupal file service from android and it is storing images in application/octet format and not in image/jpeg format in file_managed table. 

$data['file'] ='encodedimage';
$fid = file_save_data($data);


So I thought I will call file_save_data($data) to store images where I pass the image as encoded string. But it is still storing in application/octet format and not in image/jpeg.

Can somebody help me to store as image/jpeg format into file_managed table?
The Services module provide an easy to use web services enpoint to create file which do all the heavy PHP work for you.

In file_save_data(), the mime type of the file is derived automatically, likely from its filename. You can set the filename of the saved file by using the $destination argument.