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 w
application/octet-stream
or image/jpeg
is only the mime-type the HTTP client (browser) has added as additional information next to the binary file-data itself.
So the mime-type shouldn't be of any issue here. It's just that you see a difference between the requests for the case your program fails, but this must not be the cause of your issue.
So you're basically looking at the wrong place.
Instead you should add error and condition checking to your code. Especially precondition checks so that you know that your script can properly operate on the data it gets provided.
From what you have made visible in your question, there is nothing more specifically I can add. Hope this is helpful anyway.
Also the PHP Manual has a section about file-uploads which contains some useful information incl. dealing with error-cases.
Next to that your code might just have a problem with how you insert the data into your database, so the problem might not be related at all with the file-upload technically.