Sending base64 encoded image to server using HttpUrlConnection Android
问题 I'm trying to send base64 encoded images to a server using HttpUrlConnection. The problem I'm having is that most images gets sent successfully, however some generate a FileNotFound exception. My code for encoding the image can be found below. public static String encodeImage(Bitmap thumbnail) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); thumbnail.compress(Bitmap.CompressFormat.JPEG, 100, baos); byte[] b = baos.toByteArray(); String imageEncoded = Base64.encodeToString(b,Base64