java - transmissing image via android to php -


hi have code putting image json request:

jsonarray jarray=new jsonarray();         for(bitmap image:images) {             bytearrayoutputstream baos = new bytearrayoutputstream();             image.compress(bitmap.compressformat.jpeg, 90, baos);             byte[] b=baos.tobytearray();             jarray.add(base64.encodetostring(b, base64.default));         } 

and code putting file:

$json=json_decode(stripslashes($_post["query"]),true); ... ... ... mkdir("upload/ogloszenie/".$id);  $ctr=1; foreach ($json["art"]["images"] $img){     file_put_contents("upload/ogloszenie/".$id."/".md5($ctr), base64_decode($img));     $ctr++; } 

files put right catalogue there srsly corrupted. idea why happening?


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -