Hello all hope someone can can help- To fininsh my android app I just need to finish the class were the user can upload there image to the server(MySql).
All works well except except the format of the image is application/octet-stream rather than image/jpeg that is sent from my android app? Is there anyway I can open the file application/octet-stream and change it to a image/jpeg type??
php file for upload...
$fileName = $_FILES['uploaded']['name'];
$tmpName = $_FILES['uploaded']['tmp_name'];
$fileSize = $_FILES['uploaded']['size'];
$fileType = $_FILES['uploaded']['type'];
$fp = fopen($tmpName, 'rb');
$content = fread($fp, $fileSize);
$content = addslashes($content);
Works ok with a form upload form no problem there. But when used from the android app with the wrong image type it saves the blob file as empty 0, $fileSize shows the true size but when $content is created it shows nothing at all
177 rome 2.jpg image/jpeg 6876 [BLOB - 6.7 KiB] p (This is from a web page) 215 myImage.jpg application/octet-stream 1066 [BLOB - 0 B] (From phone)
Thx guys