Android image file sent to php upload image file is application/octet-stream type and not image/jpeg?
<p>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).</p>

<p>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??</p>

<p>php file for upload...</p>

<pre><code>$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);
</code></pre>

<p>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</p>

<p>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)</p>

<p>Thx guys</p>
