Coba ini,
Di Jawa:
String encode = Base64.encodeToString(bytes, Base64.DEFAULT);
di php:
$file = $_POST['file']['name'];
//$fname = $_POST['fname']['tmp_name'];
$fname = $_POST['file']['tmp_name'];
$file_path = "uploads/";
$actualpath = "http://harpal-projects.16mb.com/sbbs/$file_path/$file";
$sql = "INSERT INTO files (file,fname) VALUES ('$actualpath','$fname') ";
if(mysqli_query($con,$sql))
{
file_put_contents(base64_decode($file), $file_path);
echo "success";
}
else{
echo "fail";
}