java - Unable to save the image properly from inputstream -
i getting exact bytes of image client , saving image file in driver. not displaying @ all.
if (is != null) { file f = new file("e:/3432.jpg"); outputstream os = new fileoutputstream(f); byte[] b = new byte[1024]; int length; while ((length = is.read(b)) != -1) { os.write(b, 0, length); } is.close(); os.flush(); os.close(); }
is there problem?
this client side code android apache httpclient.
multipartentity entity = new multipartentity(); entity.addpart("type", new stringbody("photo")); entity.addpart("data", new filebody(image)); httppost.setentity(entity); httpresponse response = httpclient.execute(httppost);
Comments
Post a Comment